# Munchkins are attacking!
# The swarms will come at regular intervals.
# Whenever you can, cleave to clear the mass of enemies.
while True:
enemy = hero.findNearestEnemy()
# Use an if-statement with isReady to check "cleave":
if enemy:
ready = hero.isReady("cleave")
# Cleave!
hero.cleave(enemy)
# Else, if cleave is not ready:
hero.attack(enemy)
hero.attack(enemy)
# Attack the nearest ogre!
enemy = hero.findNearestEnemy()
hero.attack(enemy)
hero.attack(enemy)
this is python and i need help because i am stuck on this level
I think you should either continue JavaScript or start from the beginning with python, because if you start from the middle in any coding language, you’ll get confused.
You actually don’t need the last three lines. They are useless. All you have to do is to put the isReady into the if statement, as @dedreous said, add an else statement to the if enemy statement, and put your hero.attack(enemy) lines into the else statement.