- 3

What is used to create instance of class

that is __init__() method

24th Aug 2018, 6:49 PM
Umesh Langade
Umesh Langade - avatar
1 Antwort
0
The __init__ method is what is called when you create (instantiate) an instance of a class. You usually take in arguments for the instance and set the initial properties of your object here. For example: class Car(): def __init__(self, x, y): self.x = x self.y = y self.speed = 0
24th Aug 2018, 10:52 PM
Just A Rather Ridiculously Long Username