Dateiendung geändert

This commit is contained in:
msnau
2026-08-27 20:13:25 +02:00
parent 120c8a72c5
commit 2891e04afd
2 changed files with 28 additions and 0 deletions
View File
+28
View File
@@ -0,0 +1,28 @@
import random
rzahl = (random.randint(1,100))
Versuch = 1
while Versuch < 8:
print("Willkommen im Spiel, welche Zahl rätst du?")
gzahl = input("Bitte Zahl eingeben: ")
try:
gzahl = int(gzahl)
if gzahl < 1 or gzahl > 100:
print("Die Zahl ist um"), print(gzahl-100), print("zu groß")
continue
except ValueError:
print("Bruder... das ist keine erlaubte Zahl")
continue
Versuch = Versuch + 1
if gzahl > rzahl:
print("zu groß")
if gzahl < rzahl:
print("zu klein")
if gzahl == rzahl:
print ("Gewonnen!")
break
print("Es war", rzahl)