2

On Python 3.5.1, whenever I enter this:

print ("How old are you?"),  
age = raw_input()  
print ("How tall are you?" ),  
height = raw_input()  
print ("How much do you weigh?"),  
weight = raw_input()

print ("So, you're %r old, %r tall and %r heavy." % (
    age, height, weight))'

It always tells me that 'raw_input' is not defined

'How old are you? Traceback (most recent call last): File "D:/Sara/School Work/Computer Science/Python Practice/3.py", line 2, in
age = raw_input()
NameError: name 'raw_input' is not defined'

SaraE
  • 23
  • 4

3 Answers3

0

Since Python 3, you should use input() instead of raw_input().

Juan Lopes
  • 10,143
  • 2
  • 25
  • 44
0

Use input() instead of raw_input() which is Python 2.x function

Marcin Zdunek
  • 1,001
  • 1
  • 10
  • 25
0

You need to use input() instead of raw_input() in Python 3.

Raad
  • 2,675
  • 1
  • 13
  • 26