-2
name = raw_input("Hello sir! What is your name?")
print ("Nice to meet you " + name + "! Where were you born?")
born = input(" ")
print ("So your name is " + name + " and you were born in " + born + "!")

And im getting the error " Nice to meet you Will! Where were you born? Florida Traceback (most recent call last): File "C:/Users/39.cr/PycharmProjects/untitled/test.py", line 3, in born = input(" ") File "", line 1, in NameError: name 'Florida' is not defined "

2 Answers2

0

You need to use raw_input('') to get the born place name as well because you are using Python 2. On Python 3 your code would work. The reason is that in Python 2 you need to use raw_input() in order to get a string and not other object type.

0

Try this:

name = raw_input("Hello sir! What is your name?")
born = raw_input("Nice to meet you " + name + "! Where were you born?")
print("So your name is " + name + " and you were born in " + born + "!")
dashdashzako
  • 1,268
  • 15
  • 24