Problem with specific error
Posted: Tue Jul 04, 2017 5:43 pm
Hi there, just getting started with python. I have a bit of basic knowledge of the language as well as c#, but im following a tutorial and it has me typing this code but it returns an error. It is supposed to print the line "hello modnar how are you" but then the error is presented. I'm running python 2.7.9, any and all help would be greatly appreciated.
Code: Select all
>>> def hello_there():
name = input("Type your name: ")
print("Hi", name, "how are you?")
>>> hello_there()
Type your name: modnar
Traceback (most recent call last):
File "<pyshell#129>", line 1, in <module>
hello_there()
File "<pyshell#127>", line 2, in hello_there
name = input("Type your name: ")
File "<string>", line 1, in <module>
NameError: name 'modnar' is not defined