Apr-08-2018, 08:33 PM
class Fighter: def __init__(self, name): self.name = name self.health = 100 self.damage = 10 def attact(self, other_guy): other_guy.health -= self.damage qazi = Fighter("Qazi") you = Fighter("Matt") print(qazi.name) print(you.name) you.attack(qazi) print(qazi.health)I received message "AttributeError: 'fighter' object has no attribute 'attack'". I'm following youtube tutorial and this code perfectly works on a computer of a guy who's teaching.