+ 1

Taking string as Input using python idle software

Getting below error: using python idle software Taking string as Input guess=input("Enter:") Enter:hello Traceback (most recent call last): File "<pyshell#72>", line 1, in <module> guess=input("Enter:") File "<string>", line 1, in <module> NameError: name 'hello' is not defined I am not getting this error in solo learn python app.

5th Dec 2017, 11:04 AM
Sashank Reddy
Sashank Reddy - avatar
13 Respuestas
+ 2
Download python latest v from here https://www.python.org/downloads
5th Dec 2017, 11:39 AM
#RahulVerma
#RahulVerma - avatar
+ 1
Simply, write this in IDLE guess = input('Enter: ') And output would be >>> Enter: # Enter your input here # In python 3.2.7
5th Dec 2017, 11:31 AM
#RahulVerma
#RahulVerma - avatar
0
what should I give? I have given hello as my input. so iam getting the error. if I give "hello" in quotes then I am not getting any error. Any idea why slun sololearn I am not getting any error without quotes?
5th Dec 2017, 11:11 AM
Sashank Reddy
Sashank Reddy - avatar
0
Still getting the same error. Can any one please explain why i am getting this error? guess=input("Enter name \n") Enter name hello Traceback (most recent call last): File "<pyshell#89>", line 1, in <module> guess=input("Enter name \n") File "<string>", line 1, in <module> NameError: name 'hello' is not defined
5th Dec 2017, 11:14 AM
Sashank Reddy
Sashank Reddy - avatar
5th Dec 2017, 11:19 AM
Sashank Reddy
Sashank Reddy - avatar
0
https://code.sololearn.com/cnJmCWokCd6y/#py
5th Dec 2017, 11:19 AM
Sashank Reddy
Sashank Reddy - avatar
0
thats what it not working in python idle. Can you check in python idle with the same snippet
5th Dec 2017, 11:25 AM
Sashank Reddy
Sashank Reddy - avatar
0
I am using Python 2.7 is that because of this?
5th Dec 2017, 11:27 AM
Sashank Reddy
Sashank Reddy - avatar
0
oops very big difference between these 2 versions I guess.. very bad. thanks
5th Dec 2017, 11:28 AM
Sashank Reddy
Sashank Reddy - avatar
0
still the same error in 2.7
5th Dec 2017, 11:32 AM
Sashank Reddy
Sashank Reddy - avatar
0
seems its a version difference causing the error
5th Dec 2017, 11:33 AM
Sashank Reddy
Sashank Reddy - avatar
0
is Python 3 free?
5th Dec 2017, 11:35 AM
Sashank Reddy
Sashank Reddy - avatar
0
excellent raw_input is working. Saviour!!
5th Dec 2017, 11:36 AM
Sashank Reddy
Sashank Reddy - avatar