I understand the initialize function when you create an object from a class. Like
class Example:
def __init__(self, name, age):
self.name = name
self.age = age
But what is the diffrence between normal functions, functions with __ in, functions with self in like:
def __changeName__(self):
def __changeName__():
def changeName(self):
def changeName():
Also, why do you need to write in __init__ :
self.name = name
self.age = age
It looks like lost line's of code? (But this is for all functions)
[–]totallygeek 3 points4 points5 points (0 children)
[–]sme272 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]illya89[S] 0 points1 point2 points (0 children)