Re: pythagorean triples exercise
- From: Terry Reedy <tjreedy@xxxxxxxx>
- Date: Thu, 21 Oct 2010 17:18:00 -0400
On 10/21/2010 6:55 AM, Baba wrote:
Hi everyone
i need a hint regarding the following exercise question:
"Write a program that generates all Pythagorean triples whose small
sides are no larger than n.
This is not well worded. I take 'small sides' (plural) to mean the two smaller, non-hypotenuse sides (which are necessarily shorter than the hypotenuse). So the possible pairs of values i,j, where i is the shorter of the two, have
Try it with n<= 200."
Again, not well worded; I believe this is meant to be n==200, except that the program should take n as a parameter and then give it value 200, so that the could work if n were given some other value.
So the possible pairs of values i,j, where i is the shorter of the two, have j <= n (==200) and i <= j.
--
Terry Jan Reedy
.
- Follow-Ups:
- Re: pythagorean triples exercise
- From: Baba
- Re: pythagorean triples exercise
- References:
- pythagorean triples exercise
- From: Baba
- pythagorean triples exercise
- Prev by Date: Re: Python has a "really hidden encapsulation"?
- Next by Date: Re: functions, list, default parameters
- Previous by thread: Re: pythagorean triples exercise
- Next by thread: Re: pythagorean triples exercise
- Index(es):
Relevant Pages
|