Advertisement
fkudinov

15.1 Епічна Битва між 2 Арміями / Вирішуємо задачі на Python CheckIO Українською

Dec 7th, 2023 (edited)
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | Source Code | 0 0
  1. class Warrior:
  2.     pass
  3.  
  4. class Knight(Warrior):
  5.     pass
  6.  
  7. def fight(unit_1, unit_2):
  8.     return 0
  9.  
  10. if __name__ == '__main__':
  11.     #These "asserts" using only for self-checking and not necessary for auto-testing
  12.  
  13.     chuck = Warrior()
  14.     bruce = Warrior()
  15.     carl = Knight()
  16.     dave = Warrior()
  17.     mark = Warrior()
  18.  
  19.     assert fight(chuck, bruce) == True
  20.     assert fight(dave, carl) == False
  21.     assert chuck.is_alive == True
  22.     assert bruce.is_alive == False
  23.     assert carl.is_alive == True
  24.     assert dave.is_alive == False
  25.     assert fight(carl, mark) == False
  26.     assert carl.is_alive == False
  27.  
  28.     print("Coding complete? Let's try tests!")
Tags: checkio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement