Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Book:
- shape = 'circle'
- material = 'paper'
- is_paper = True
- def __init__(self, code):
- self.code = code
- if code < 300:
- print('*****')
- class Electronni(Book):
- material = 'not paper'
- waterproof = 'yeah'
- wIFI = 'yeah'
- is_not_paper = False
- page = 1
- def __add__(self, other):
- self.page += other
- def __sub__(self, other):
- self.page = self.page - other
- def __str__(self):
- return f'сторінка: {self.page}, code: {self.code}'
- def foo(self):
- pass
- pro = Electronni(122)
- pro + 12
- pro - 12
- print(pro)
- ''.format(1, 33)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement