So far you have only been printing, but you haven't been able to get any input from a person, or change it. You may not even know what "input" means, so rather than talk about it, let's have you do some and see if you get it. Next exercise we'll do more to explain it.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
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)
代码运行结果如下:
Notice that we put a , (comma) at the end of each print line. This is so that print doesn't end the line with a newline and go to the next line