Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- class Warrior:
- health = 0
- damage = 0
- def __init__(self, health, damage):
- self.health = health
- self.damage = damage
- def get_health(self):
- return self.health
- def get_damage(self):
- return self.damage
- def take_damage(self, damage):
- self.health -= damage
- class Platoon:
- list_of_warriors = []
- def __init__(self, members_count):
- for i in range(members_count):
- warrior = Warrior(randint(80,121), randint(7,13))
- self.list_of_warriors.append(warrior)
- def show_members(self):
- for i in self.list_of_warriors:
- print(f'HP - {i.get_health()}, Damage - {i.get_damage()}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement