AtEchoOff

Python Warmup Player fighting stuff

Jul 26th, 2025
742
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | Source Code | 0 0
  1. class Player:
  2.     def __init__(self, name, health, attack):
  3.         self.name = name
  4.         self.health = health
  5.         self.attack = attack
  6.  
  7. class Enemy:
  8.     def __init__(self, name, health, attack):
  9.         self.name = name
  10.         self.health = health
  11.         self.attack = attack
  12.  
  13. def fight(player, enemy):
  14.     # Your code here
  15.     return ""
  16.  
  17. # Example usage
  18. p = Player("Hero", 100, 20)
  19. e = Enemy("Bat", 50, 10)
  20. print(fight(p, e))
Advertisement
Add Comment
Please, Sign In to add comment