Why code is throwing error and what should I do to correct it? Code in description
import random playerhealth = 150 enemyhealth = 200 attack = int(input("Attack!\n[1]Punch\n[2]Kick,[3]Knee,[4]Headbutt")) damage = [30,90,50,10] damaged = damage.choice(damage) def attacks() : if attack == 1 : print("You used Punch\n") global enemyhealth enemyhealth = enemyhealth - damaged print("damage to enemy",damaged,"\n") print(enemyhealth) elif attack == 2 : print("You used Kick\n") global enemyhealth enemyhealth = enemyhealth - damaged print("damage to enemy",damaged,"\n") print(enemyhealth) elif attack == 3 : print("You used Knee\n") global enemyhealth enemyhealth = enemyhealth - damaged print("damage to enemy",damaged,"\n") print(enemyhealth) elif attack == 4 : print("You used Headbutt\n") global enemyhealth enemyhealth = enemyhealth - damaged print("damage to enemy",damaged,"\n") print(enemyhealth) else : print("haaaaad")