1

I've been working on a project recently to refresh on my Python, and I need to set a variable to a name. name = raw_input("What is your name?") Is what I have so far, and I can't get it to set the variable (name) to be any word. When I put print (name) in the line after, it comes up with an error. How do I set the variable to anything that the player inputs?

Oliver
  • 11
  • 1

1 Answers1

0

If you are using python version 3.x then for raw_input() you will got error saying NameError: name 'raw_input' is not defined. For python3.X you can use name = input("What is your name?")

while what you are doing will run in python2.X perfectly.

Vineet Jain
  • 1,515
  • 4
  • 21
  • 31