Certified Associate in Python Programming (PCAP) — Question 103
What is true about Python class constructors? (Choose two.)
Answer options
- A. there can be more than one constructor in a Python class
- B. the constructor must return a value other than None
- C. the constructor is a method named __init__
- D. the constructor must have at least one parameter
Correct answer: C, D
Explanation
Option C is correct because the constructor in Python is indeed named __init__. Option D is also correct since the constructor requires at least one parameter, usually 'self'. Options A and B are incorrect; Python does not support multiple constructors in the traditional sense, and the constructor does not need to return a value other than None.