0

This is my first experience with a programming language. I was executing this code in python and I got the error. please help me.

 print("welcome")
name=input("\nHi, What's your name ?")
age=input("\nHow old are you?")
weight=int(input("How many pounds do you weight?"))



   print("Hello,",name, "you are ", age, " years old. And you weigh ",weight," pounds")
santosh
  • 107
  • 2
  • 3
  • 6
  • when I entered the name 'san', it gave the following error: File “”, line 1, in NameError: name 'san' is not defined – santosh Mar 18 '15 at 14:14

1 Answers1

5

Are you sure you are running with python 3.x?

This looks like a python2.x Error to me - running your Code under python 3 Works like a charm.

If you replace input with raw_input it Works with 2.x as well

R4PH43L
  • 2,122
  • 3
  • 18
  • 30
  • @OP: You can check the version you are running under with `import sys; print(sys.version)` – Kevin Mar 18 '15 at 14:40