Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Unit:
- def init(self,unit_type,attack_value,defend_value):
- self.type=str(unit_type)
- self.attack=int(attack_value)
- self.defend=int(defend_value)
- unit = Unit('tank',9,4)
- print(unit)
- print(unit.type)
- print(unit.attack)
- print(unit.defend)
- '''
- ================== RESTART: C:/dev/python/python_combat.py ==================
- Traceback (most recent call last):
- File "C:/dev/python/python_combat.py", line 7, in <module>
- unit = Unit('tank',9,4)
- TypeError: Unit() takes no arguments
- >>>
- '''
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement