python nameerror input

Try using raw_input instead.

Here is what the above code is Doing:
1. It’s asking the user to input a number.
2. It’s converting the input to an integer.
3. It’s storing the integer in the variable num.
4. It’s printing the value of num.

If you want to use raw_input instead, you can do this:

num = raw_input(“Please enter a number: “)
print num

This will do the same thing as the code above, but it will use raw_input instead of input.