NameError: name 'h' is not defined in my code

https://replit.com/@DougieEarl/Adventure-Game
When you type in anything like h for help, it says

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'h' is not defined"

Screenshot 2023-07-02 at 11.36.30 AM
You can’t use or in an equality condition, you would have to do something similar to what you did on line 109.
Also, line 86 is indented one too many spaces

5 Likes

Oh! I completely forgot that I needed to do that. Thanks for the help!

1 Like

Only looking at the title.it seems that you are in shell mode(thus the ) and has not defined a variable called h.

2 Likes

Looking at the post,it seems that you are not running the repl and your inputs just go to shell,instead of the input function.

2 Likes

Line 32 should to have only 1 equal sign.

@DougieEarl you should use

if rolequestion == "h": ...

No need for two bug-causing hs.

2 Likes