Quiz on exec() function
FREE Online Courses: Click, Learn, Succeed, Start Now!
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Quiz is loading…
You must sign in or sign up to start the quiz.
You must first complete the following:
Results
Results
0 of 15 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0)
Earned Point(s): 0 of 0, (0)
0 Essay(s) Pending (Possible Point(s): 0)
Categories
- Not categorized 0%
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- Current
- Review / Skip
- Answered
- Correct
- Incorrect
-
Question 1 of 15
1. Question
- What is the input given to the exec() function?
CorrectIncorrect -
Question 2 of 15
2. Question
- How many arguments of the exec() function are optional?
CorrectIncorrect -
Question 3 of 15
3. Question
- Which of the following is not correct about the exec() function?
CorrectIncorrect -
Question 4 of 15
4. Question
- Which of the following is true about the difference between exec() and eval()?
CorrectIncorrect -
Question 5 of 15
5. Question
What is the value returned by the exec() function?
CorrectIncorrect -
Question 6 of 15
6. Question
What is the output of the below code?
exec(‘a=10\nprint(a*3)’)
CorrectIncorrect -
Question 7 of 15
7. Question
Find the output of the following code block if the input is ‘s=0nfor i in range(10): s=s+i’.
print(exec(‘input(“Enter a program: “)’))
CorrectIncorrect -
Question 8 of 15
8. Question
- Which of the following code give an error?
CorrectIncorrect -
Question 9 of 15
9. Question
What is the output of the below code?
exec(”’
name=”PythonGeeks”
if(“g” in name):
print(“Hi”)
else:
print(“Hello”)
”’)CorrectIncorrect -
Question 10 of 15
10. Question
What is the output of the below code?
exec(“””a=5
def func():
a=8
print(a,end=’,’)
func()
print(a)“””)
CorrectIncorrect -
Question 11 of 15
11. Question
Which of the following do not give any output?
CorrectIncorrect -
Question 12 of 15
12. Question
What is the output of the below code?
exec(‘print(abs(-3))’,{})
CorrectIncorrect -
Question 13 of 15
13. Question
What is the output of the below code?
exec(‘print(pow(3,4))’,{‘__builtins__’:None},{‘print’:print})
CorrectIncorrect -
Question 14 of 15
14. Question
- Which of the following do not give any error?
CorrectIncorrect -
Question 15 of 15
15. Question
What is the output of the below code?
a=5
b=6
c=7
exec(‘print(a+7-b//c)’,{‘c’:c},{‘a’:a,’b’:b})CorrectIncorrect