练习5 更多变量

name = 'Zed A. Shaw'
age = 35 # not a lie
height_inches = 74 #inches
weight_lbs = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
height = height_inches * 2.54
weight = weight_lbs * 0.4536

print "Let's talk about %s." % name
print "He's %d centerMeter tall." % height
print "He's %d kilogram heavy." % weight
print "Actually that's not too heavy."
print "He's got %s eyes and %s hair." %(eyes,hair)
print "His teeth are usually %s depending on the coffee." % teeth

this line is tricky, try to get it exactly right

print "If I add %d,%d, and %d I get %d." % (age,height,weight,age + height + weight)

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容