19 Answers

New AnswerElse Statement Pythagoras theorem says: In a right-angled triangle, the square of the hypotenuse side is equal to the sum of squares of the other two sides. Write a program that takes lengths of triangle sides as inputs, and output whether our triangle is right-angled or not. If the triangle is right-angled, the program should output "Right-angled", and "Not right-angled" if it's not. Sample Input 3 4 7 Sample Output Not right-angled [Take the 3rd input (side3 variable in sample code) as the longest side, which will represent the hypotenuse if the triangle is right-angled.] ________ My solution: side1 = int(input()) side2 = int(input()) side3 = int(input()) #your code goes here side1 *= side1 side2 *= side2 side3 *= (side1 * side1) + (side2 * side2) if side3 <= (side1*side1) + (side2*side2): print("Right-angled") else: print ("Not right-angled") __________ My solution works for 2 tests, but not the other 2..

9/22/2020 9:44:00 PM

Zone19 Answers

New Answer
Hot Today

How did I do it? I am not pro but I solved the pro problem
For learning ethical hacking which os is best for beginners?
How can I add video in my html code using dropbox?
How can I improve my JavaScript skills?
Any suggestions of best platforms to learn C languages?,
C++ Binary sequence increment
What is your favourite SoloLearn course and why?
Why do some people mark Antartica as their location
Which should I want to learn first for game development ? Please tell me...
Sololearn is telling me "You cannot respond to this conversation". But why.

Learn Playing. Play Learning

SoloLearn Inc.

4 Embarcadero Center, Suite 1455San Francisco, CA 94111

© 2020 SoloLearn, Inc.

Send us a message