Pythagorean triplets X91267


Statement
 

pdf   zip

html

Write a function is_pythagorean(a, b, c) that receives as argument three integers greater than zero and returns True when the square of one of these arguments is the sum of the squares of the other two. Otherwise the function returns False.

Sample session
>>> is_pythagorean(3, 5, 4)
True
>>> is_pythagorean(2, 1, 1)
False
>>> is_pythagorean(13, 5, 12)
True
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python