0

else statement challenge

the question with Pythagoras theorem where you have to make if else statement and output whether its right angled or not right angled...I pass all but test case #3 and I cant see it because it is hidden..here is my code side1 = int(input()) side2 = int(input()) side3= int(input()) pt= side1+side2 if side3 != pt: print( "Right-angled") else: print("Not right-angled") TIA!

5th Sep 2020, 7:46 PM
MISKAR
MISKAR - avatar
2 odpowiedzi
+ 1
Based on Pythagoras Theorem, triangle would be right-angled when a^2 + b^2 == c^2, where c is the longest edge Also, edit title and tags to inform correctly this question is about challenge.
5th Sep 2020, 8:14 PM
BlazingMagpie
BlazingMagpie - avatar
0
thanks. will try edit: I was definitly overthinking it and made it way more complicated than it needed to be! thank you!!
5th Sep 2020, 8:20 PM
MISKAR
MISKAR - avatar