Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
| gf_informatik:programmieren_ii [2025-11-10 13:38] – [Aufgabe D4] hof | gf_informatik:programmieren_ii [2025-11-20 14:22] (aktuell) – hof | ||
|---|---|---|---|
| Zeile 145: | Zeile 145: | ||
| == Teil I== | == Teil I== | ||
| - | <code python> | + | <html>< |
| x = int(input(' | x = int(input(' | ||
| y = int(input(' | y = int(input(' | ||
| print(x + y) | print(x + y) | ||
| - | </code> | + | </bottom-editor></ |
| == Teil II== | == Teil II== | ||
| Einfach: | Einfach: | ||
| - | <code python> | + | <html>< |
| x = int(input(' | x = int(input(' | ||
| y = int(input(' | y = int(input(' | ||
| Zeile 162: | Zeile 162: | ||
| else: | else: | ||
| print(y) | print(y) | ||
| - | </code> | + | </bottom-editor></ |
| === Aufgabe A2 === | === Aufgabe A2 === | ||
| - | <code python> | + | <html>< |
| n = int(input(" | n = int(input(" | ||
| Zeile 174: | Zeile 174: | ||
| print(" | print(" | ||
| - | </code> | + | </bottom-editor></ |
| === Aufgabe A3 === | === Aufgabe A3 === | ||
| == Teil I == | == Teil I == | ||
| - | <code python> | + | <html>< |
| a = int(input(" | a = int(input(" | ||
| b = int(input(" | b = int(input(" | ||
| Zeile 187: | Zeile 187: | ||
| print(c) | print(c) | ||
| print(a) | print(a) | ||
| - | </code> | + | </bottom-editor></ |
| == Teil II == | == Teil II == | ||
| - | <code python> | + | <html>< |
| n = int(input(" | n = int(input(" | ||
| summe = 0 | summe = 0 | ||
| Zeile 198: | Zeile 198: | ||
| summe = summe + zahl | summe = summe + zahl | ||
| print(summe) | print(summe) | ||
| - | </code> | + | </bottom-editor></ |
| === Aufgabe A4 === | === Aufgabe A4 === | ||
| Zeile 844: | Zeile 844: | ||
| <code python> | <code python> | ||
| + | import random | ||
| + | |||
| + | questions = 0 | ||
| + | correct = 0 | ||
| + | |||
| + | while questions < 10: | ||
| + | questions = questions + 1 | ||
| + | |||
| + | x = random.randint(1, | ||
| + | y = random.randint(1, | ||
| + | result = x + y | ||
| + | answer = int(input(f' | ||
| + | if answer == result: | ||
| + | correct = correct + 1 | ||
| + | |||
| + | print(f' | ||
| </ | </ | ||
| ++++ | ++++ | ||
| </ | </ | ||