Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Weapon:
- def __init__(self, bullets):
- self.bullets = bullets
- def shoot(self):
- if self.bullets > 0:
- self.bullets -= 1
- return "shooting..."
- return "no bullets left"
- def __repr__(self):
- return f"Remaining bullets: {self.bullets}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement