YouTip LogoYouTip

Python Exercise Example94

# Python2.x Python Exercise Instance 94 [![Image 3: Python 100 Examples](#) Python 100 Examples](#) **Title:** Time function example 4, a number guessing game to judge a person's reaction speed. **Program Analysis:** None. Program source code: ## Instance(Python 2.0+) #!/usr/bin/python# -*- coding: UTF-8 -*-if __name__ == ' __main__ ': import time import random play_it = raw_input('do you want to play it.('y' or 'n')')while play_it == 'y': c = raw_input('input a character:n')i = random.randint(0,2**32) % 100 print'please input number you guess:n'start = time.clock()a = time.time()guess = int(raw_input('input your guess:n'))while guess != i: if guess>i: print'please input a
← Python Exercise Example95Python Exercise Example93 β†’