[Tutor] Re:Help on Tutor

Nitin Gangahar Nitin Gangahar" <nitin_gangahar@rediffmail.com
Sat Jul 26 02:20:02 2003


Hello!
       I think Alan's absolutely right.I've got the code here it 
is:
import time
mytime=time.localtime( )
number=mytime[4]
guess=-1

while guess != number:
     guess = input("Guess a number: ")

     if guess > number :
         print "Too high"

     elif guess < number :
             print "Too low"

print "Just right"






>"""
>Rewrite the high_low.py program from section 5.2 to use the last 
>two
>digits of time at that moment to be the 'random' number.
>"""
>"""
>Rewrite the high_low.py program from section 5.2:
>
>     1.  To use the last two digits of time at that moment.
>
>     2.  To be the 'random' number.
>"""
>
>Can anyone confirm that this is what Josh meant?

>I think its simpler than that. Josh is simply saying use the
>time() function to get a number. Take the last two digits
>and use them instead of 78 as the target. As Isaac said,
>the trick is to 'think strings'
>
>Alan G.
___________________________________________________
Download the hottest & happening ringtones here!
OR SMS: Top tone to 7333
Click here now: 
http://sms.rediff.com/cgi-bin/ringtone/ringhome.pl