Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
gf_informatik:programmieren_ii [2025-11-10 13:38] – [Aufgabe D4] hofgf_informatik:programmieren_ii [2025-11-20 14:22] (aktuell) hof
Zeile 145: Zeile 145:
 == Teil I== == Teil I==
  
-<code python>+<html><bottom-editor>
 x = int(input('Gib eine Zahl ein')) x = int(input('Gib eine Zahl ein'))
 y = int(input('Gib eine Zahl ein')) y = int(input('Gib eine Zahl ein'))
 print(x + y) print(x + y)
-</code>+</bottom-editor></html>
  
 == Teil II== == Teil II==
  
 Einfach: Einfach:
-<code python>+<html><bottom-editor>
 x = int(input('Gib eine Zahl ein')) x = int(input('Gib eine Zahl ein'))
 y = int(input('Gib eine Zahl ein')) y = int(input('Gib eine Zahl ein'))
Zeile 162: Zeile 162:
 else: else:
     print(y)     print(y)
-</code>+</bottom-editor></html>
  
  
 === Aufgabe A2 === === Aufgabe A2 ===
-<code python>+<html><bottom-editor>
 n = int(input("Gib Startzahl von Countdown ein!")) n = int(input("Gib Startzahl von Countdown ein!"))
  
Zeile 174: Zeile 174:
  
 print("Los!") print("Los!")
-</code>+</bottom-editor></html>
  
 === Aufgabe A3 === === Aufgabe A3 ===
 == Teil I == == Teil I ==
-<code python>+<html><bottom-editor>
 a = int(input("Gib Zahl ein")) a = int(input("Gib Zahl ein"))
 b = int(input("Gib Zahl ein")) b = int(input("Gib Zahl ein"))
Zeile 187: Zeile 187:
 print(c) print(c)
 print(a) print(a)
-</code>+</bottom-editor></html>
  
 == Teil II == == Teil II ==
-<code python>+<html><bottom-editor>
 n = int(input("Gib Zahl ein")) n = int(input("Gib Zahl ein"))
 summe = 0 summe = 0
Zeile 198: Zeile 198:
     summe = summe + zahl     summe = summe + zahl
 print(summe) print(summe)
-</code>+</bottom-editor></html>
  
 === 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, 20)
 +    y = random.randint(1, 20)
 +    result = x + y
 +    answer = int(input(f'Was ergibt {x} + {y} ?'))
 +    if answer == result:
 +        correct = correct + 1
 +
 +print(f'Du hast {correct} von 10 Aufgaben richtig gelöst!')
 </code> </code>
  
 ++++ ++++
 </nodisp> </nodisp>
  • gf_informatik/programmieren_ii.1762781898.txt.gz
  • Zuletzt geändert: 2025-11-10 13:38
  • von hof