[Tutor] clock.py
Feziwe Mpondo
feziwe at sanbi.ac.za
Mon May 23 17:54:05 CEST 2005
clock.py,problem is to get the last two digits to be random.her's what i
tried
from time import time,ctime
prev_time = ""
while(1):
the_time = ctime()
if (prev_time != the_time):
print "The time is :",ctime(time())
prev_time = the_time
guess = 0
number = 1-60
while guess != number:
guess = input ("Guess the last two digits:")
if guess > number:
print "Too high"
elif guess < number:
print "Too low"
print "Just right"
More information about the Tutor
mailing list