-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex5.py
More file actions
28 lines (23 loc) · 832 Bytes
/
ex5.py
File metadata and controls
28 lines (23 loc) · 832 Bytes
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
name = 'Zed A Shaw'
age = 35 # not a lie
height = 74 # inches
weight = 180 # lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
height_in_feet = 0
height_in_cm = 0
print "Let's talk about %s." % name
print "He's %d inches tall." % height
print "He's %d pounds heavy." % weight
print "Actually that's not too heavy."
print "He's got %s eyes and %s hair." % (eyes, hair)
print "His teeth are usally %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)
# Study Drill
# Convert inches to feet and centimeters
height_in_feet = float(height / 12.0)
print "%s 's height in feet is %d" % (name, height_in_feet)
height_in_cm = float(height * 2.54)
print "%s 's height in centimeters is %d" % (name, height_in_cm)