Q. What is the purpose of a constructor?

A
Destroy objects
B
Initialize objects
C
Call methods
D
Delete attributes
Solution:

A constructor, __init__, initializes object attributes when created.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!