Computer Science
Write a program to input 3 sides of a triangle and print whether it is an equilateral, scalene or isosceles triangle.
Answer
a = int(input("Enter first side : "))
b = int(input("Enter second side : "))
c = int(input("Enter third side : "))
if a == b and b == c :
print("Equilateral Triangle")
elif a == b or b == c or c == a:
print("Isosceles Triangle")
else :
print("Scalene Triangle")
Output
Enter first side : 10
Enter second side : 5
Enter third side : 10
Isosceles Triangle
Related Questions
Write a program to take an integer a as an input and check whether it ends with 4 or 8. If it ends with 4, print "ends with 4", if it ends with 8, print "ends with 8", otherwise print "ends with neither".
Write a short program to print the following series :
(i) 1 4 7 10 ………. 40.
(ii) 1 -4 7 -10 ………. -40Write a program to take N (N > 20) as an input from the user. Print numbers from 11 to N. When the number is a multiple of 3, print "Tipsy", when it is a multiple of 7, print "Topsy". When it is a multiple of both, print "TipsyTopsy".
Write a short program to find average of list of numbers entered through keyboard.