0
Ok guys can anyone explain about the error I'm getting for the following code :
anyname=input ("What's ur name? ") print("Welcome aboard Mr", anyname, "to our society" ) Gave input as ashish And the error is Traceback (most recent call last): File "./a.py", line 2, in <module> anyname=input("Whats ur name sir?") File "<string>", line 1, in <module> NameError: name 'ashish' is not defined
12 Answers
+ 1
try : python3 a.py
+ 1
Oh sorry I found the error.. My default python is 2.7
While compiling I tried now as python3.6./a.py it worked fine now
+ 1
Thank you all :)
0
it works just fine. no errors
0
I tried in the solo learn's terminal it works fine. But here in Linux it's showing this error
0
Is there any way I can post a screenshot here?
0
That code works fine on PC as well. Check that you have it in that format on your computer as well. You should be able to post links here as far as i know
0
Check out the screenshot
https://imgur.com/a/WARsF
0
Which version of python are you using?
0
3.6
0
Yes try that.
0
You are welcome!