dimanche 10 mars 2019

Python random game

Python random game crashing!

idk whats wrong so if i am debugging its working but if i want to open this code in my cmd its instantly crashing

import random

w = 0
zahl = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15"]
zahhl = random.choice(zahl)
print(zahhl)

while w < 1:
antwort = input("Rate welche zahl es ist: ")
if antwort == zahhl:
    print("Richtig!")
    w = w + 2
elif antwort < zahhl:
    print("Die gesuchte zahl ist größer! ")
elif antwort > zahhl:
    print("Die gesuchte zahl ist kleiner! ")




Aucun commentaire:

Enregistrer un commentaire