aboutsummaryrefslogtreecommitdiff
path: root/src/Lecture4/live/live4.py
blob: b011675f980a68d75cc838a46db75f0a6b1cd7b7 (plain)
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
38
39

def fun(a, b):
	print("This is function fun")
	print("I am executing!")
	print("Your parameter a:", a)
	z = a + b
	if z > 10:
		print("Your sum is large!", z)
	while z > 5:
		print("Decreasing sum:", z-1)
		z = z - 1

#fun(2, 11)
#print("..")
#fun(0, 7)

def g(x, y):
	#print("This is function g")
	return (x**2 +1)*y
	
print(g(10,2)-100)


def fibo(n):
	if n == 0:
		return 0
	if n == 1:
		return 1
	return fibo(n-1) + fibo(n-2)



print(fibo(5))
F = [fibo(x) for x in range(6)]
print(F)




Generated with cgit - Back to sebastiano.tronto.net