Certified Associate in Python Programming (PCAP) — Question 124
What is true about Python class constructors? (Choose two.)
Answer options
- A. there can be only one constructor in a Python class
- B. the constructor cannot be invoked directly under any circumstances
- C. the constructor cannot return a result other than None
- D. the constructor's first parameter must always be named self
Correct answer: A, C
Explanation
Option A is correct because a Python class can only have one constructor method, which is defined by the __init__() method. Option C is also correct since the constructor in Python cannot return anything other than None. Options B and D are incorrect; the constructor can be invoked directly in certain contexts, and while 'self' is a convention, the first parameter can technically be named differently, although it is not recommended.