#!/usr/bin/python # exact position of python
#!/usr/bin/env python # position of python in enviornment
# -*- coding:utf-8 -*- # coding
my_name = 'kin zhang'
my_age = 29 # it's true
my_height = 180 # cm
my_weight = 65 # kg
my_eyes = 'Brown'
my_teeth = 'White'
my_hair = 'Black'
print "Let's talk about %s." % my_name
print "He's %d cm tall." % my_height
print "He's %d kg heavy." % my_weight
print "Actually that's too light."
print "He's got %s eyes and %s hair." % (my_eyes, my_hair)
print "His teeth are usually %s depending on the coffee." % my_teeth
# this line is tricky, try to get it exactly right
print "If I add %d, %d, and %d I get %d." % (
my_age, my_height, my_weight, my_age + my_height + my_weight)
Python Exercise #5
最新推荐文章于 2015-08-18 11:45:46 发布