print "How old are you?",
age = raw_input()
print "How tall are you?",
height = raw_input()
print "How much do you weight?",
weight = raw_input()
print "So,you're %r old, %r tall and %r heavy." %(age,height,weight)
本博客通过一个简单的Python脚本示例,介绍了如何使用raw_input()函数从用户获取输入,并将这些信息打印出来。代码演示了如何询问用户的年龄、身高和体重,然后以格式化的字符串输出这些信息。
print "How old are you?",
age = raw_input()
print "How tall are you?",
height = raw_input()
print "How much do you weight?",
weight = raw_input()
print "So,you're %r old, %r tall and %r heavy." %(age,height,weight)

被折叠的 条评论
为什么被折叠?