pythagorean triples exercise

Baba raoulbia at gmail.com
Thu Oct 21 06:51:07 EDT 2010


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.
Try it with n <= 200."


what is "n" ? i am guessing that it is a way to give a bound to the
triples to be returned but i can't figure out where to fit in "n".

a^a + b^b = c^c is the condition to satisfy and i need to use loops
and "n" will be an upper limit of one (or more?) of the loops but i am
a bit lost. Please help me get thinking about this right.

exercise source: Java by Dissection (Ira Pohl and Charlie McDowell)

thanks

Baba



More information about the Python-list mailing list