Microsoft Word

Python input not working(solution)

If your python input not working is not working here is what to do. Before showing you how to solve this I am using python in vs code not with Pycharm or another editor but still, it should work. But before checking your code first should be considered as the first option. Sometimes the problem source may be the python version installed or other reasons to be clear there is an example here.

python input not working vscode

let’s assume you have this code  where we are asking someone to fill his name and surname:

Name = input (“Enter your name”)
Surname =input (“Enter your Surname”)
print(“Your full name is :”, Name,Surname)

The error may come from an old version of python. The same code is giving an error while executed in this online python compiler with the version of V2.7.13

Screenshot 48

Now, the same  code is being compiled in another online python compiler which execute version 3 of python and it working correctly without running into error.

Screenshot 47

And finally the code is executed using vs code as editor we did not run into error as shown down.The problem may come from the python version installed because I have tried the same in different python compilers with different versions some of them execute the code others could not just show an error.

Screenshot 49

But if you still have a problem event though you have the latest version of python and also running it in vs code here is how to fix it:

  1. Go to file in the to left conner
  2. Click preferences and then settings
  3. Search for run in terminal and select the box Whether to run code in integrated terminal.

Close vs code and then open it , it will work.

Screenshot 50
Screenshot 51

Leave a Comment

Your email address will not be published. Required fields are marked *