Re: can someone with guessing a number

2008-05-22 Thread abhilash pp
Gary, There is a problem in using this sys.exit() if you are working in windows IDLE, then it will ask you for an 'exit altogether' so either change your 'while' clause or restructure your whole program to fit your idea :-) to avoid failed and success messages together cheers , abhilash On Wed

Re: can someone with guessing a number

2008-05-21 Thread Dan Upton
On Wed, May 21, 2008 at 12:55 PM, abhilash pp <[EMAIL PROTECTED]> wrote: >> On Wed, May 21, 2008 at 10:12 PM, garywood <[EMAIL PROTECTED]> wrote: >>> >>> I would just like the program to exit after guessing the amount of >>> numbers wrong >>> >>> # Guess My Number >>> import random >>> the_number =

Re: can someone with guessing a number

2008-05-21 Thread Dan Upton
On Wed, May 21, 2008 at 12:42 PM, garywood <[EMAIL PROTECTED]> wrote: > I would just like the program to exit after guessing the amount of numbers > wrong > > # Guess My Number > import random > the_number = random.randrange(100) + 1 > tries = 1 > # guessing loop > while (guess != the_number): >

Re: can someone with guessing a number

2008-05-21 Thread abhilash pp
if tries > 10: print 'you failed- give up' break <--- use this On Wed, May 21, 2008 at 10:24 PM, abhilash pp <[EMAIL PROTECTED]<[EMAIL PROTECTED]>> wrote: > > > if tries > 10: > print 'you failed- give up' > > > On Wed, May 21, 2008 at 10:12 PM, gar

Re: can someone with guessing a number

2008-05-21 Thread abhilash pp
if tries > 10: print 'you failed- give up' On Wed, May 21, 2008 at 10:12 PM, garywood <[EMAIL PROTECTED]> wrote: > I would just like the program to exit after guessing the amount of > numbers wrong > > # Guess My Number > import random > the_number = random.randrange(100) + 1 > trie