hey what program when given 3 numbers outputs true if the numbers form a pythagorean triplet
brixton d
-1
Newbie Poster
Recommended Answers
Jump to Posthttp://en.wikipedia.org/wiki/Pythagorean_triple and http://mathworld.wolfram.com/PythagoreanTriple.html are excellent references. You just make your code and ask any question of …
Jump to PostThen you can use math.hypot, output is though (True, True, True, False, True) for your example, if you do not test first that values are all integers, so first check for that, then you get (True, True, False, False, True).
All 6 Replies
TrustyTony
888
pyMod
Team Colleague
Featured Poster
brixton d
-1
Newbie Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
brixton d
-1
Newbie Poster
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.