/
RSS Feed
Bei der Mehrfachauswahl wird eine Variable auf verschiedene Werte geprüft und entsprechend des Variablenwerts werden unterschiedliche Anweisungen ausgeführt.
Beispiel: Notengebung entsprechend der erreichten Prozente
prozent = 99
note = 0
if prozent >= 95:
note = 1
elif prozent >= 85:
note = 2
elif prozent >= 68:
note = 3
elif prozent >= 50:
note = 4
elif prozent >= 30:
note = 5
else:
note = 6
print("Note:", note)