Advertisement
Roman_Sarnov

Untitled

Sep 27th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. class Human():
  2. def __init__(self, name, age, hobby):
  3. self.name = name
  4. self.age = age
  5. self.hobby = hobby
  6. self.money = 100
  7. def desctibsion(self):
  8. all_characteristics = 'Данные:' + '\n' + 'Имя: ' + self.name + '\n' + 'Возраст: ' + str(self.age) + '\n' + \
  9. 'Хобби: ' + self.hobby + '\n' + 'Деньги: ' + str(self.money)
  10. print(all_characteristics)
  11. def go_work(self):
  12. print('Сходил на работу')
  13. self.money += 10
  14. human = Human("Роман", 17, "Программирование")
  15. human.desctibsion()
  16. human.go_work()
  17. human.desctibsion()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement