Quiz on Python Functions – Range(), zip(), eval(), exec(), Repr()
Python is the language of the common man. Thus, has plenty of inbuilt functions to make the life of the developer’s easy. With this Python quiz on functions, we will test our knowledge of some of the in-built functions like range(), eval() and many more. Let’s get started with the quiz. All the best!
Time limit: 0
Quiz Summary
0 of 15 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which of the following is the function of the exec() function in Python?
Correct
Incorrect
Question 8 of 15
8. Question
What are the input type and output type in the eval() function?
Correct
Incorrect
Question 9 of 15
9. Question
Zip() function in python is also known as?
Correct
Incorrect
Question 10 of 15
10. Question
What maximum number of arguments can we pass to the range() function in python?
Correct
Incorrect
Question 11 of 15
11. Question
# Code snippet starts
print(eval(‘1 2 == 2’))
# Code snippet ends
Correct
Incorrect
Question 12 of 15
12. Question
# Code snippet starts
org = “QuizOrbit”
print(list(zip(org))[-1])
# Code snippet ends
Correct
Incorrect
Question 13 of 15
13. Question
# Code snippet starts
org = “QuizOrbit”
print(list(range(org))[-1])
# Code snippet ends
Correct
Incorrect
Question 14 of 15
14. Question
# Code snippet starts
program = ‘a = 52\nb=13\nprint(a+b)’
exec(program)
# Code snippet ends
Correct
Incorrect
Question 15 of 15
15. Question
# Code snippet starts
print(exec(‘1’))
# Code snippet ends
Correct
Incorrect
Summary
With this quiz, we assume that you might have developed a clear understanding of the in-built functions in Python like exec(),eval(),range() and zip(). We recommend you move ahead with the next quiz only after you solve all your queries on this topic. Happy Learning!
# 1. Question
# Code snippet starts
for i in range(5):
print(i, end=” “)
# Code snippet ends
# Answer in Visual Studio code: 0 1 2 3 4
# But this quiz answered: 0 1 2 3 4 5