78.0k views
2 votes
Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is an equilateral triangle.

1 Answer

6 votes

sides = ([])

i = 0

while i < 3:

side = float(input("Enter the length of one side: "))

sides.append(side)

i += 1

if sides.count(sides[0]) == 3:

print("Your triangle is an equilateral triangle.")

else:

print("Your triangle is not an equilateral triangle.")

I hope this helps!

User Atreat
by
5.6k points