aidanharris
Nov 26, 2013 - 19:50
For some reason the following code does not work:
a=input('input something: \n')
print(a)
It produces the following error message even if I wrap the input in str()

For some reason the following code does not work:
a=input('input something: \n')
print(a)
It produces the following error message even if I wrap the input in str()

That's correct behavior. input() attempts to parse whatever is entered as a direct Python statement. If you want user input, you probably want raw_input():
a=raw_input('input something: \n')
print(a)