# Python Example – Write a Python program to check a triangle is equilateral, isosceles or scalene # (Python Example for Citizen Data Scientist & Business Analyst)

Write a Python program to check a triangle is equilateral, isosceles or scalene.

Note :
An equilateral triangle is a triangle in which all three sides are equal.
A scalene triangle is a triangle that has three unequal sides.
An isosceles triangle is a triangle with (at least) two equal sides.

Sample Solution:

Python Code:

``````
print("Input lengths of the triangle sides: ")

x = int(input("x: "))
y = int(input("y: "))
z = int(input("z: "))

if x == y == z:
print("Equilateral triangle")
elif x==y or y==z or z==x:
print("isosceles triangle")
else:
print("Scalene triangle")
``````

Sample Output:

```x: 6
y: 8
z: 12
Scalene triangle```

## Write a Python program to check a triangle is equilateral, isosceles or scalene

#### Free Machine Learning & Data Science Coding Tutorials in Python & R for Beginners. Subscribe @ Western Australian Center for Applied Machine Learning & Data Science. ```