Re: pythagorean triples exercise



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

.



Relevant Pages

  • pythagorean triples exercise
    ... i need a hint regarding the following exercise question: ... "Write a program that generates all Pythagorean triples whose small ... and "n" will be an upper limit of one of the loops but i am ...
    (comp.lang.python)
  • Re: pythagorean triples exercise
    ... i need a hint regarding the following exercise question: ... "Write a program that generates all Pythagorean triples whose small ... and "n" will be an upper limit of one of the loops but i am ...
    (comp.lang.python)
  • pythagorean triples exercise
    ... i need a hint regarding the following exercise question: ... "Write a program that generates all Pythagorean triples whose small ... and "n" will be an upper limit of one of the loops but i am ...
    (comp.lang.python)
  • Re: pythagorean triples exercise
    ... i need a hint regarding the following exercise question: ... then generate the Pythagorean triples where A and B ... loops, one each for a, b, and c. ...
    (comp.lang.python)
  • Re: Paul and Pepe, Silver hit 35.69 today
    ... Hint: Longer, or shorter than the history of the United States? ...
    (rec.gambling.poker)