Игра в угадайку:
import random
import sys
running = True
number = random.randint (1, 5)
print ('Guess the number from 1 to 5 to WIN')
print ('or enter "0" to EXIT\n')
while running:
guess = int(input('Enter a number\n'))
if guess == number:
print ('YOU WIN!!!')
running = False
elif guess > number:
print ('Your number is bigger')
print ('Try again\n')
elif guess == 0:
sys.exit('Closing...')
else:
print ('Your number is less')
print ('Try again\n')
input ('Press ENTER to exit')
print ('Closing...')