Usual day / Help plz. My code is too short


#1
# Defeat munchkins, collect coins. Everything as usual.
# Use AND to check existence and type in one statement.

while True:
    enemy = hero.findNearestEnemy()
    item= hero.findNearestItem()
    # With AND, the type is only checked if enemy exists.
    if enemy and enemy.type == "munchkin":
        hero.attack(enemy);
    if item and item.type=="coin":
        pos=item.pos
        hero.moveXY(pos.x, pos.y)
# Collect item if it exists and its type is "coin".


#2

Try to remove the line 11
use

item.pos.x, item.pos.y

#3

plus you would need a space

pos = item.pos


#4

It’s stylistic and doesn’t affect on the results.


#5

sorry. I didn’t know. That was what it taught you.


#6

How did you complete it? I’ve tried to do what the others have said and it didnt work.
What did you do?