-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex21_drill.py
More file actions
38 lines (26 loc) · 751 Bytes
/
ex21_drill.py
File metadata and controls
38 lines (26 loc) · 751 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
29
30
31
32
33
34
35
36
37
# function drill
# return number 998
g_value = 998
def add(a, b):
print "adding %d + %d" % (a, b)
return a + b
def substract(a, b):
print "substract %d - %d" % (a, b)
return a - b
def multiply(a, b):
print "mulitply %d * %d" % (a, b)
return a * b
def divide(a, b):
print "Divide %d / %d" % (a, b)
return a / b
print "Ok, let's do some math with this thing."
one = add(666, 666) # 1332
two = substract(400, 100) # 300 # 1332 - 334 = 998
three = multiply(8, 4) # 1332 - 300 = 1032
four = divide(68, 2) #34 || 1032 - 34 = 998
print "Ok, let's look at the result."
def score(a, b, c, d):
print "Let's print the g_value: ",
return a - b - c - d
g_value = score(one, two, three, four)
print g_value