[Tutor] Python riddles

jfouhy@paradise.net.nz jfouhy at paradise.net.nz
Mon May 9 01:15:31 CEST 2005


Quoting "Jacob S." <keridee at jayco.net>:

> Unfortunately, after about 50 pages or so, it stops, apparently using
> too much memory, or something causing the computer to lock badly enough I
> have to wait for 5 minutes for the keyboard interupt to work. I believe it
> also hints in the source that I should do this about 300 times? I just want
> to know if I'm on the right track, and maybe a slight push in a better,
> less memory consuming direction...

When I did riddle 4, my loop was "for i in range(320)", and I had a break
condition as well (if I didn't find a number of the right form).  The break
condition triggered before the for loop exhausted its range.

If you saw the line with two numbers, and you modified your code so that it only
picks up the right one, then you should be able to solve the riddle, I think..

-- 
John.


More information about the Tutor mailing list