Python Forum

Full Version: Getting Error : User Input
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am not able to identify what will be the error could be, please help

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)
Error
./main.py[2]: 0403-057 Syntax error at line 2 : `(' is not expected.
you don't need commas on lines 1, 3, 5
Also as a newbie you should start learning python3, not python2

To make it even better, you can pass the question in the raw_input
age = raw_input("How old are you? ")
height = raw_input("How tall are you? ")
weight = raw_input("How much do you weigh? ")
print "So, you're {} old, {} tall and {} heavy.".format(age, height, weight)
but again, start with python3, not python2