Here are 10 Python multiple-1
Here are 10 Python multiple-1
9. Which of the following methods can be used to get the length of a dictionary?
a) len()
b) size()
c) count()
d) length()
Answer: a) len()
10. What is the purpose of the self keyword in Python classes?
a) It is used to initialize the class.
b) It refers to the instance of the class.
c) It is a placeholder for a variable.
d) It is used to call a function inside the class.
Answer: b) It refers to the instance of the class.