import time
health = 100
kidsHP = 10
def kidsenemyattack():
global health
print('The enemy deals damage!')
health -= 4
print(health)
print('==========')
time.sleep(3)
kidsenemyattack()
def kidfight():
global kidsHP
ready = input('You can attack!')
if ready in ['1','one','One']:
kidsHP -= 1
time.sleep(2.5)
while health > 0:
kidsenemyattack() and kidfight()
if kidsHP <= 0:
print('You've defeated the evil kids")
Instead of both of the definitions doing what I want (Which is draining my health over time and informing me that I can attack) kidsenemyattack() just overrides kidfight() and vice versa.
I want both of them to be able to be do their functions without one overriding the other.