Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Python elif not responding

So I have this function called --cmd_skeleton(enemy)-- and I want the program to print out the function. cmd skeleton.

It's located on personal game https://w.trhou.se/cnpjhlp40q

 if start == '1':
    print("You went diving")
  elif enemy == 'skeleton':
    cmd_skeleton(enemy)

Variables and functions are defined in my code upthere but the error is with the elif enemy it's doesn't respond

Hope you can help.

1 Answer

Steven Parker
Steven Parker
243,228 Points

:point_right: On lines 3 and 4 you set enemy to 'Skeleton', which will not match because of the upper-case S.

Oh ... I'm so dumb but still thanks a lot ! :D But now i have another issue

My game doesn't repeat. Once i kill my monster it prints back the main screen but then no commands are accepted. Is my while loop not well configured or is it something else?

My new code : https://w.trhou.se/opoqk8f5df

Hope you can help me :]