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)
Note
每行 print 后面加了个逗号(comma) , 这样的话 print 就不会输出新行符而结束这一行跑到下一行去了。
结果
$ python ex11.py
How old are you? 35
How tall are you? 6'2"
How much do you weigh? 180lbs
So, you're '35' old, '6/'2"' tall and '180lbs' heavy.
$
加分习题
新闻热点
疑难解答