Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class main():
- def __init__(self):
- self.x = 'abc'
- class child(main):
- def __init__(self):
- main.__init__(self) # wywołuje bo potrzebuje self.x z klasy main
- self.y = 'd'
- def printer(self):
- print(self.x, self.y) # tu nie umiem sie odwołać do self.y z klasy child.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement