#!/usr/bin/env python
# coding:utf-8
import random
j = 3
while True:
for i in range(j):
num = input("please input num: ")
if num.isdigit():
num = int(num)
# print(num)
n = random.randint(1, 50)
# print(n)
if num > n:
print("too large")
if num < n:
print("too small")
if num == n:
print("you are right")
exit()
print("you have", j-1-i, "choice")
else:
print("not a num")
print("you have", j-1-i, "choice")
print("game over.... ")
while True:
q = input("play again? yes/no ")
if q in ['yes', 'y']:
pass
elif q == 'no' or q =='n':
exit()