Answer to Question #185990 in Python for J NAGAMANI

Question #185990

Given three sides of the triangle(a, b, c) as input. Write a program to determine whether the triangle is Equilateral, Isosceles or Scalene.Input


The first line of input will contain an integer A.

The second line of input will contain an integer B.

The third line of input will contain an integer C.Output


If the given sides A, B and C are equal, print "Equilateral".

In the given sides any of two sides are equal print "Isosceles".

If the given sides A, B, C are not equal to each other, print "Scalene".Explanation


For example, if the given sides are 4, 4, 4 the output should be "Equilateral".

Similarly, if the given sides are 3, 2, 3 the output should be "Isosceles".


1
Expert's answer
2021-04-27T16:13:45-0400
A = int(input())
B = int(input())
C = int(input())

if A == B and B == C:
    print('Equilateral')
elif A != B and A != C and B != C:
    print('Scalene')
else:
    print('Isosceles')

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