Add keyboard interrupt
This commit is contained in:
parent
f09d4ba213
commit
20d5499bf9
|
@ -4,7 +4,8 @@ random.seed()
|
|||
number = random.randrange(100, 999)
|
||||
number = list(str(number))
|
||||
guesses = 0
|
||||
while True:
|
||||
try:
|
||||
while True:
|
||||
|
||||
if guesses == 5:
|
||||
print("You loose!")
|
||||
|
@ -31,3 +32,5 @@ while True:
|
|||
print(hint[index], end=" ")
|
||||
guesses += 1
|
||||
print("\n")
|
||||
except KeyboardInterrupt:
|
||||
pass
|
Loading…
Reference in New Issue