forked from msnow/Schmyrhon
Dateiendung geändert
This commit is contained in:
@@ -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)
|
||||||
Reference in New Issue
Block a user