Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error input() – Name: name ‘…’ is not defined in python. So Here I am Explain to you all the possible solutions here.
Without wasting your time, Let’s start This Article to Solve This Error.
How input() – Name: name ‘…’ is not defined Error Occurs?
Today I get the following error input() – Name: name ‘…’ is not defined in python.
How To Solve input() – Name: name ‘…’ is not defined Error ?
- How To Solve input() – Name: name '…' is not defined Error ?
To Solve input() – Name: name '…' is not defined Error
- input() – Name: name '…' is not defined
You are running Python 2, not Python 3. For this to work in Python 2, use
input_variable = raw_input ("Enter your name: ") print ("your name is" + input_variable)
Since you are writing for Python 3.x, you’ll want to begin your script with:
If you use:
It will default to Python 2.x. These go on the first line of your script, if there is nothing that starts with #! (aka the shebang).
If your scripts just start with:
Then you can change it to:
Although this shorter formatting is only recognized by a few programs, such as the launcher, so it is not the best choice.
The first two examples are much more widely used and will help ensure your code will work on any machine that has Python installed.
It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.