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

Keeping Time help plz

# Use your new skill to choose what to do: hero.time

while True:
    # If it's the first 10 seconds, attack.
    if hero.time < 10:
        enemy = hero.findNearestEnemy()
        hero.attack(enemy)
        pass
    # Else, if it's the first 35 seconds, collect coins.
    elif hero.time < 35:
        item = hero.findNearestItem()
        if item.type == "coin" and item.value == 2:
            hero.moveXY(item.pos.x, item.pos.y)
        pass
    # After 35 seconds, attack again!
    else:
        hero.attack(enemy)
        pass

I need help :worried::worried::worried::worried::worried:

Delete the if statement:
if item.type == "coin" and item.value == 2

you just need to delete and item.value == 2

Alexander_gu has already said that.

dont give out answers it doesnt let them learn