-
Notifications
You must be signed in to change notification settings - Fork 0
/
ex5mod.py
32 lines (26 loc) · 849 Bytes
/
ex5mod.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
name = 'Zed A. Shaw'
age = 35 # not a lie
height = 74 # inches
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
# testing %r
print "Let's talk about %r." % name
print "He's %r inches tall." % height
print "He's %r pounds heavy." % weight
print "Actually that's not too heavy"
print "He's got %r eyes and %r hair." % (eyes, hair)
print "His teeth are usually %r 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)
# Ok, lets do some metric Conversions
print ""
print ""
print "Ok, lets do some metric conversions:"
print "%s is %d inches tall" % (name, height)
print "That is %d cm tall" % (height * 2.54)
print ""
print "%s weights %d" % (name, weight)
print "That is %r kilos." % (weight * 0.453592)