[Tutor] Re:Help on Tutor

Jared W jaredw1234567@hotmail.com
Sun Jul 27 03:53:02 2003


Hello Nitin,
    The part I had trouble on was getting the last two digits from the time. 
  Your program is exactly what I'm looking for, but could you explain how 
you did that?  It works and it's right, but I don't understand how you did 
what you did.  Thanks to everyone who helped.

Jared


>From: "Nitin  Gangahar" <nitin_gangahar@rediffmail.com>
>Reply-To: "Nitin  Gangahar" <nitin_gangahar@rediffmail.com>
>To: jaredw1234567@hotmail.com
>CC: tutor@python.org
>Subject: Re:Help on Tutor
>Date: 26 Jul 2003 06:21:47 -0000
>
>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
>
>

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail