0
Can you explain "__init__" to me? Please.
I don't understand "data = None" in this code: def __init__(self, data = None, next = None): self. data=data self.next=next Can you explain it to me? What does it mean? And Can you send to me example for it. Thank you so much.
2 Answers
+ 2
__init__ automatically runs when an object of a class is instantiated.
data = None just means that by default variable data has the value None.
It can be overridden by passing a value when creating the object
0
Thank you đ It can be overridden. I understand !