Skip to content

Instantly share code, notes, and snippets.

@TheonlyTazz
Created December 13, 2022 09:43
Show Gist options
  • Save TheonlyTazz/afe3246e19ed937e699f2c4a5c148d9b to your computer and use it in GitHub Desktop.
Save TheonlyTazz/afe3246e19ed937e699f2c4a5c148d9b to your computer and use it in GitHub Desktop.
Lernfeld 5 Nassi-Schneider Diagramm
def Aufgabe1():
z = 0
for i in range(1, 4):
z = z * i
print(f"Aufgabe 1: {z}")
def Aufgabe2():
z = -2
i = 99
while i > 88:
z = z+3
z = -z
i = i-2
print(f"Aufgabe 2: {z}")
def Aufgabe3():
i = 0
z = 0
while i < 20:
j = i
while j < 20:
z = z + j
j = j + 1
i = i +5
print(f"Aufgabe 3: {z}")
def Aufgabe4():
z = 4
i = 4
while i > 0:
z = z + 4
z = z / i
i = i -1
print(f"Aufgabe 4: {z}")
def Aufgabe6():
i = 10
z = 100
while i > 0:
if i % 2 == 0:
z = z - i
else:
z = z + i
i = i - 1
print(f"Aufgabe 6: {z}")
Aufgabe1()
Aufgabe2()
Aufgabe3()
Aufgabe4()
print("Aufgabe 5: 1 oder 2")
Aufgabe6()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment