Answer to Question #342850 in Python for smkv

Question #342850

You are given with a list of positive integers nums, return whether there exist integers a, b, and c such that a ** 2 + b ** 2 = c ** 2.


1
Expert's answer
2022-05-19T16:41:03-0400



ls=list(map(int,input().split()))
for a in range(len(ls)-2):
  for b in range(a+1,len(ls)-1):
    for c in range(b+1,len(ls)):
      if ls[a]**2+ls[b]**2==ls[c]**2:
        print([ls[a],ls[b],ls[c]])

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS