Certified Associate in Python Programming (PCAP-31-03) — Question 77
What is true about Python class constructors? (Choose two.)
Answer options
- A. the constructor is a method named __init__
- B. there can be more than one constructor in a Python class
- C. the constructor must return a value other than None
- D. the constructor must have at least one parameter
Correct answer: A, D
Explanation
Option A is correct because the constructor in Python is indeed defined by the method __init__. Option D is also correct as constructors require at least one parameter, typically 'self', to initialize the class instance. Options B and C are incorrect; Python does not support multiple constructors directly, and constructors do not return values other than None.