Guest User

Untitled

a guest
Feb 1st, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.35 KB | None | 0 0
  1. class House:
  2.  
  3.     def __init__(self):
  4.         self.cat_bowl = 0
  5.         self.dirty = 0
  6.  
  7.  
  8. class Man:
  9.  
  10.     def __init__(self, name):
  11.         self.name = name
  12.         self.mood = 'унылое'
  13.         self.house = None
  14.         self.money = 1000000
  15.  
  16.     def status(self):
  17.         print('Я - {}, настроение - {}, денег - {}'.format(
  18.             self.name, self.mood, self.money))
  19.  
  20.     def buy_house(self, house):
  21.         self.house = house
  22.         self.money -= 999990
  23.         self.mood = 'блестящее'
  24.  
  25.     def go_work(self):
  26.         print('{} сходил на работу'.format(self.name))
  27.         self.money += 50
  28.         self.mood = 'уставшее'
  29.  
  30.     def play_DOTA(self):
  31.         print('{} играл целый день в ДОТУ'.format(self.name))
  32.         self.mood = 'отдохнувшее'
  33.  
  34. class Cat(object):
  35.  
  36.     def __init__(self, name):
  37.         self.name = name
  38.         self.fulness = 0
  39.         self.mood = 50
  40.         self.house = None
  41.  
  42.     def status(self):
  43.         print('Я - {}, сытость - {}, настроение - {}'.format(
  44.             self.name, self.fulness, self.mood))
  45.  
  46.     def meow(self):
  47.         print('Мяяяяяяу!')
  48.  
  49.     def eat(self):
  50.         pass
  51.  
  52.     def sleep(self):
  53.         pass
  54.        
  55.  
  56. vasya = Man(name='Вася')
  57. vasya.status()
  58.  
  59. home = House()
  60. vasya.buy_house(house=home)
  61. vasya.status()
  62.  
  63. vasya.go_work()
  64. vasya.status()
  65. vasya.play_DOTA()
  66. vasya.status()
  67.  
  68. murzik = Cat(name='Мурзик')
  69. murzik.status()
  70. murzik.meow()
Add Comment
Please, Sign In to add comment