diff --git a/exercises/code/fib_down.py b/exercises/code/fib_down.py new file mode 100644 index 0000000..2f600b1 --- /dev/null +++ b/exercises/code/fib_down.py @@ -0,0 +1,11 @@ +def fib_normal(n: int): + elements = [0, 1] + for i in range(n): + elements.append(elements[i] + elements[i+1]) + + for i in range(n): + # Man beachte hier das Element an der Stelle 0 wird hier nicht ausgegeben da n-i minimal 1 werden kann + print(elements[n-i]) + +fib_normal(10) + diff --git a/exercises/code/fib_up.py b/exercises/code/fib_up.py new file mode 100644 index 0000000..c20c40b --- /dev/null +++ b/exercises/code/fib_up.py @@ -0,0 +1,32 @@ +def fib_normal(n: int): + a: int = 0 + b: int = 1 + for _ in range(n): + print(b, end=", ") + tmp = b + b = a + b + a = tmp + print() + +fib_normal(10) + +x = "1" +x_int = int(input()) + +x: str = input() +y: str = input() + +def mod(a: int, b:int): + return a % b + + +if x % 2 == 0: + ... + +elif x % 3 == 0: + ... + +elif x % 4 == 0: + ... + +