Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Human():
- def __init__(self, name, age, hobby):
- self.name = name
- self.age = age
- self.hobby = hobby
- self.money = 100
- def desctibsion(self):
- all_characteristics = 'Данные:' + '\n' + 'Имя: ' + self.name + '\n' + 'Возраст: ' + str(self.age) + '\n' + \
- 'Хобби: ' + self.hobby + '\n' + 'Деньги: ' + str(self.money)
- print(all_characteristics)
- def go_work(self):
- print('Сходил на работу')
- self.money += 10
- human = Human("Роман", 17, "Программирование")
- human.desctibsion()
- human.go_work()
- human.desctibsion()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement