Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class House:
- def __init__(self):
- self.cat_bowl = 0
- self.dirty = 0
- class Man:
- def __init__(self, name):
- self.name = name
- self.mood = 'унылое'
- self.house = None
- self.money = 1000000
- def status(self):
- print('Я - {}, настроение - {}, денег - {}'.format(
- self.name, self.mood, self.money))
- def buy_house(self, house):
- self.house = house
- self.money -= 999990
- self.mood = 'блестящее'
- def go_work(self):
- print('{} сходил на работу'.format(self.name))
- self.money += 50
- self.mood = 'уставшее'
- def play_DOTA(self):
- print('{} играл целый день в ДОТУ'.format(self.name))
- self.mood = 'отдохнувшее'
- class Cat(object):
- def __init__(self, name):
- self.name = name
- self.fulness = 0
- self.mood = 50
- self.house = None
- def status(self):
- print('Я - {}, сытость - {}, настроение - {}'.format(
- self.name, self.fulness, self.mood))
- def meow(self):
- print('Мяяяяяяу!')
- def eat(self):
- pass
- def sleep(self):
- pass
- vasya = Man(name='Вася')
- vasya.status()
- home = House()
- vasya.buy_house(house=home)
- vasya.status()
- vasya.go_work()
- vasya.status()
- vasya.play_DOTA()
- vasya.status()
- murzik = Cat(name='Мурзик')
- murzik.status()
- murzik.meow()
Add Comment
Please, Sign In to add comment