Home > Software engineering >  why am I not able to input the data
why am I not able to input the data

Time:11-17

I was learning python as a beginner through YouTube. In the video I was following the output was shown in terminal, but not in my case. It doesn't even accept taking in data for the variable. What am I doing wrong?

the code was simply :

a = input("Enter name")
print(a)

but the output would only show the text, but wont let me type the input

CodePudding user response:

You code should be working fine. Maybe, you are trying to edit the text Enter name, which is not possible in the terminal.

Try typing the name and pressing <Enter> when the text Enter name shows up.

You can test it here: enter image description here

If you install the code-runner extension and use Run Code button. You need to add the following code to your settings.json (shortcuts "Ctrl shift P" and type Preferences : Open User Settings):

"code-runner.runInTerminal": true,

By the way, read docs is a good choice.

  • Related