Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Python Plz Help :)


#1

Hello
I’m making a mistake.
He’s attacking but not the others.I tried while True.
Python lvl 30/45

Great,
CloneSnow


#2

you are not equipped with glasses. You cannot see very far without them. The code is fine, you just don’t have the correct equipment.


#3

As @MunkeyShynes said, you have not earned the while true: loop yet. Rework your code so that the code that the while true loop would normally repeat is in there.


#4

Your code looks absolutely wright for passing the level. Do you have any error message? Is you keyboard at US settings?

hero.attack(enemy3)
# same raw
hero.attack(enemy2)
# same raw
hero.attack(enemy1)
# same raw

experiment with the attacking order
I also need help:
Never understood these levels:

enemy = "Ursa"
hero.attack(enemy) # this works, but WHY?
print(enemy.id)     # raises a NULL error as expected
hero.attack("Ursa") # raises an error as expected

This 'feature" can be exploited in many levels, no glaces needed, but why this exists?


#5

in response to your question,

redefines “Ursa” as enemy, so that is why

works but not


#6

It’s because @CloneSnow doesn’t have glasses.