Python Forum
Getting Error : User Input - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Getting Error : User Input (/thread-12669.html)



Getting Error : User Input - aankrose - Sep-06-2018

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.


RE: Getting Error : User Input - buran - Sep-06-2018

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