Python Shift Enter Problems

Hi, I’m just starting my coding journey.

I’ve got two issues going on here, I hope you can help.

  1. When running code for the first time, I have to use the run button and not Shift + Enter. I get an error my variable is not a commandlet. It’s like Python is not loaded in the terminal so it’s running natively in cmd. If I type Python in the terminal first or use the run button it works.

  2. For x I’m getting NameError: name is not defined. Again it works if I use the run button but if I use Shift + Enter to execute the code I get the nameerror.

Thanks in advance for your suggestions. I’m running Python 3.10.4 on Win 10.

month = input("What month are you going on holiday? ")



x = int(month) + 1



Traceback (most recent call last):
File “”, line 1, in
NameError: name ‘x’ is not defined