0

input function not behaving as expected.. Why?

>>> input("Enter a number: ") Enter a number: goodtogo Traceback (most recent call last): File "<pyshell#48>", line 1, in <module> input("Enter a number: ") File "<string>", line 1, in <module> NameError: name 'goodtogo' is not defined >>> input("Enter a number: ") Enter a number: 5 5

20th Nov 2016, 12:26 PM
Gaurav Agrahari
Gaurav Agrahari - avatar
1 Answer
0
That's strange. My IDLE gives me following: >>> input("Enter a number: ") Enter a number: goodtogo 'goodtogo'
20th Nov 2016, 1:26 PM
donkeyhot
donkeyhot - avatar