From d6c61d988bfa4255baf9cdae42db59ebee38363f Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Tue, 25 May 2021 17:10:49 +0200 Subject: Added files --- src/Lecture4/live/live4.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/Lecture4/live/live4.py (limited to 'src/Lecture4/live/live4.py') diff --git a/src/Lecture4/live/live4.py b/src/Lecture4/live/live4.py new file mode 100644 index 0000000..b011675 --- /dev/null +++ b/src/Lecture4/live/live4.py @@ -0,0 +1,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) + + + + -- cgit v1.3