Обратите внимание, что input () и print () в Python2 .x немного отличаются от python3 .x Поэтому сначала проверьте версию python.
Python2.x:
password = raw_input('prompt to user')
print 'hello world'
Python3.x:
password = input('prompt to user')
print('hello world')
Then, when you define a while loop in the command line, you should leave a line empty and press Enter after while loop completed, enter the rest of your code.
As I showed in the above picture, I left a line empty then press enter
, then I entered my rest of codes.
If you wanna run your code in Python v3
, in the command prompt or Linux shell enter: python3
If you got error please download the latest version of python
Finally, as others say, please use an IDE like vscode
and enter your entire code then run it, less trouble!!!
Download VisualStudio Code:
(https://code.visualstudio.com/download).