Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung | |||
| de:modul:m319:learningunits:lu05:aufgaben:carryon [2025/06/23 07:45] – gelöscht - Externe Bearbeitung (Unbekanntes Datum) 127.0.0.1 | de:modul:m319:learningunits:lu05:aufgaben:carryon [2025/06/23 07:45] (aktuell) – ↷ Seite von modul:m319:learningunits:lu05:aufgaben:carryon nach de:modul:m319:learningunits:lu05:aufgaben:carryon verschoben msuter | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| + | ====== LU05.A08: Carry on? ====== | ||
| + | <WRAP center round info 60%> | ||
| + | Schreibe ein Programm das die Frage "Carry on?" stellt, bis der Benutzer die Zeichenfolge " | ||
| + | </ | ||
| + | |||
| + | ===== Auftrag ===== | ||
| + | Implementiere die Aufgabe auf zwei verschiedene Arten: | ||
| + | - Schleife mit einer Bedingung | ||
| + | - Endlosschleife mit '' | ||
| + | |||
| + | ==== Beispiel ==== | ||
| + | |||
| + | < | ||
| + | Carry on? | ||
| + | **yes** | ||
| + | Carry on? | ||
| + | **ye** | ||
| + | Carry on? | ||
| + | **y** | ||
| + | Carry on? | ||
| + | **no** | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | ===== Vorlage ===== | ||
| + | <code python> | ||
| + | def main_condition(): | ||
| + | # Write your program with a condition here and remove the line " | ||
| + | while condition: | ||
| + | pass | ||
| + | | ||
| + | def main_infinite(): | ||
| + | # Write your program with break here and remove the line " | ||
| + | while True: | ||
| + | # use break here | ||
| + | pass | ||
| + | |||
| + | if __name__ == ' | ||
| + | main_condition() | ||
| + | main_infinite() | ||
| + | </ | ||
| + | |||
| + | Anmerkung: Kümmere dich ich im Moment nicht zu sehr um '' | ||
| + | Dieser Programmblock legt fest, welche Funktion beim Ausführen gestartet wird. | ||
| + | Wir werden dies im Verlauf des Moduls noch genauer betrachten. | ||
| + | |||
| + | < | ||
| + | ---- | ||
| + | {{tag> | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | Diese Aufgabe ist eine übersetzte und angepasste Aufgabe von [[https:// | ||
| + | |||