Quiz on Python len() Function



1. What does the len() function in Python do?
2. Which types of objects can the len() function be used on?
3. What will be the output of len([])?
4. How would you use len() to find the length of a string 'Hello'?
5. What is the output of len({'a': 1, 'b': 2})?

Advertisements