Roman_Sarnov

Untitled

Sep 27th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 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. self.health = 50
  8. def desctibsion(self):
  9. all_characteristics = 'Данные:' + '\n' + 'Имя: ' + self.name + '\n' + 'Возраст: ' + str(self.age) + '\n' + \
  10. 'Хобби: ' + self.hobby + '\n' + 'Деньги: ' + str(self.money) + '\n' + 'Здоровье: ' + \
  11. str(self.health)
  12.  
  13. print(all_characteristics)
  14. def go_work(self):
  15. print('Сходил на работу')
  16. self.money += 10
  17.  
  18. def go_magazine(self):
  19. print('Сходил в магазин')
  20. self.money -=10
  21. def use_drug(self):
  22. print('Принял лекарства')
  23. self.health += 10
  24.  
  25. def smoking(self):
  26. print('Покурил')
  27. self.health -= 10
Advertisement
Add Comment
Please, Sign In to add comment