Message: 2 Date: Wed, 9 Aug 2006 16:04:27 +1200 From: "John Fouhy" <[EMAIL PROTECTED]> Subject: Re: [Tutor] Exercise in writing a python function. To: "Tutor mailing list" <tutor@python.org> Hi Kermit, Your basic data structure is a list (actually, several related lists), which you work your way through. So I would start off with a for loop: for k in range(len(mult)): Then, in the body of the loop, your basic logic is: Add 1 to mult[k]. If mult[k] is not too big, exit. Otherwise, ... Hmm, actually, I'm not sure I do understand. Does mpylist ever change? How is mult related to zlim? -- John. ***** Thank you. I confused things by my mistake in the specifications. The criterion for exiting the outer loop is that mpylist[0][1] * mult[0] + mpylist[1][1] * mult[1] + mpylist[2][1] * mult[2] + . . . be > zlim.
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor