Making a call to input() and during run time a user passes a value ‘x’ and Python outputs the error “input name ‘x’ is not defined”
The Python method input() reads in a user input and actually executes it as python code so the value passed in was not valid Python.
1. Pass in valid Python code e.g. a method call
2. Use the Python method raw_input() in the case where a user is expected to pass in a value e.g. string,integer etc. which can be stored as a python variable e.g.
someInput = raw_input(‘please enter a value:’)