1
2
3
4
5
6
7
8
9
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 就不会输出新行符而结束
这一行跑到下一行去了。
记住 %r 是 debug 专用,它显示的是原始表示出来的字符,而 %s 是为了显示给用户
时间: 2024-10-30 23:35:15