Skip to content

Commit 8c644a4

Browse files
committed
fibonacci: Variablen besser benannt.
1 parent d42fdcb commit 8c644a4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎Level_03/fibonacci.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
anzahl = int(input("Wie viele Elemente sollen berechnet werden? "))
1010

1111
# Die ersten beiden Elemente sind fix:
12-
a = 0 # a ist das jeweils aktuelle Element.
13-
b = 1 # b ist das jeweils nächste Element.
12+
current = 0 # current ist das jeweils aktuelle Element.
13+
next = 1 # next ist das jeweils nächste Element.
1414

1515
for n in range(anzahl): # type: int
1616
# Gebe das aktuelle Element aus:
17-
print(" * ", a)
17+
print(" * ", current)
1818

1919
# Setze das aktuelle Element eins weiter
2020
# und das nächste auf die Summe des letzten und des aktuellen Elements.
21-
a, b = b, a+b
21+
current, next = next, current + next

0 commit comments

Comments
 (0)