Quiz on Python repr() Function Explained



1. What does the repr() function return in Python?
2. Which of the following is the primary purpose of the repr() function?
3. What will be the output of repr(42)?
4. What is the difference between str() and repr()?
5. What will be the result of calling repr() on a list?

Advertisements