Professional Documents
Culture Documents
- print(ct1(5, 3, 2))
- print(ct1(5, 4, 2))
print(ct1(4, 3, 2))
CT 2 of 4:
def ct2():
print(42, end='')
# no return statement!
print(ct2())
CT 3 of 4:
- print(ct3(9, 3))
- print(ct3(4, 3))
print(ct3(7, 3))
CT 4 of 4:
# h(x,y) is used by ct4
def ct4():
w = h(8, 4)
x = h(4, 8)
y = h(8, 3)
z = w + 10 * x + 100 * y
print(z)
ct4()
def ct2(x, y, z):
a = int(x) / int(y)
print(ct2(6, 4, 3))
def ct1(x):
print(x + 10)
x = x + 25 // 10
print(x)
x -= 3
print(x)
return x == 0
ct1(10)
def ct1(x, y):
print(ct1(137,42))
print(ct1(42, 731))
def f(z):
return 2*z
def g(z):
z += 1
return z/2
def h(z):
if (z > 3):
return z + f(g(z))
else:
return g(z)
def ct2(z):
print(h(z-1))
z *= 2
return h(z)
print(ct2(3)