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