Thanks for everyone’s help!
I tried the same thing. I’m getting an error saying I have more than 1 if else statements.
Your else is too soon - best to save it for a catchall at the end of all your ifs. Removing the else from your code will leave 3 ifs, which should work fine.
We should use the variable value to print the contents which are not rope. I find no instructions as to how to embed the variable value in the print statement. “A” variable "is not useful right now "???
Hey folks! I’ve managed to finish the final mountain-related task. Is there a way that I could have my else statement use the name of the equipment item in the print statement?
I’m trying to get it to work in a manner where it’ll output something like:
“This compass is of no use to you”
Thanks in advance for any help you can offer.
Also, does my code look ok? I have the niggling feeling that I’ve missed something even though the app passed me.
Good point! We don’t explicitly teach how to combine a string and a variable’s value, but it is in several puzzles (such as Math Modifier). This comment from another thread may be useful, in short: you can use the
+ symbol to combine a variable and a string, for example:
print(element + ' is not useful right now')
Hope this helps!
I have to put “A” first before the element variable. The program keeps introducing backslashes for me behind the inner single quotes.
OK Thanks, all fixed. I’d stick in a screen shot but I don’t know how.
Looks like you’ve got an extra
element === 'rope' at the top of your for loop that isn’t needed. If you remove that are you able to solve the puzzle?
thank you i reslove it
bueno la solución fue mas fácil de lo que esperaba. gracias grasshopper…