# coding=gbk # coding=utf-8 # -*- coding: UTF-8 -*- from encodings import utf_8 import random print ( ' -------- Guess the game -------- ----- ' ) num1 = int(input( " Please enter the number of intervals to start: " )) num2 = int(input( " Please enter the number of ending intervals: " )) number = random.randint(num1,num2) while True: temp = int(input( ' Guess a number: ' )) if number == temp: print ( ' Congratulations on your guess! ' ) break elif number > temp: print ( ' smaller ' ) elif number < temp: print ( ' bigger ' ) elif temp.isdigit(): continue else : print ( ' game over ' )