forked from mwarkentin/Learn-Python-The-Hard-Way
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex5.py
22 lines (19 loc) · 743 Bytes
/
ex5.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
name = 'Zed A. Shaw'
age = 35 # not a lie
height = 74 # inches
height_in_cm = height * 2.54
weight = 180 # lbs
weight_in_kg = weight * 0.45359237
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
print "Let's talk about %r." % name
print "He's %r inches tall (%r cm)." % (height, height_in_cm)
print "He's %r pounds heavy (%r kg)." % (weight, weight_in_kg)
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 %r, %r, and %r I get %r." % (
age, height, weight, age + height + weight)
# All formatting characters: %d, %i, %o, %u, %x, %X, %e, %E, %f, %F, %g, %G, %c, %r, %s