-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
# Add a code block here, if required
import random
Schritt 1: Generiere eine Zufallszahl zwischen 1 und 100
zufallszahl = random.randint(1, 100)
Schritt 2: Begrüßung und Anweisung
print("Willkommen zum Zufallszahl-Spiel!")
print("Ich habe eine Zahl zwischen 1 und 100 gewählt. Kannst du sie erraten?")
Schritt 3: Wiederhole, bis der Benutzer die Zahl errät
while True:
# Benutzereingabe
ratezahl = int(input("Gib eine Zahl zwischen 1 und 100 ein: "))
# Überprüfung und Feedback
if ratezahl < zufallszahl:
print("Zu niedrig!")
elif ratezahl > zufallszahl:
print("Zu hoch!")
else:
print("Richtig! Du hast die Zahl erraten!")
break # Beendet die Schleife
CPython versions tested on:
3.10
Operating systems tested on:
Windows
Metadata
Metadata
Assignees
Labels
type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error