Write a python program to find the perimeter of a
triangle. Input the sides of the triangle .
eg: p= s1+s2+s3
Answers
Answered by
1
side1=int(input("enter the first side"))
side2=int(input("enter the second side"))
side3=int(input("enter the third side"))
print("the perimeter is "+side1+side2+side3)
Answered by
2
Required Answer:-
Question:
- Write a python program to find the perimeter of a triangle.
Solution:
Here comes the program.
a=float(input("Enter length of first side: "))
b=float(input("Enter length of second side: "))
c=float(input("Enter length of third side: "))
p=a+b+c
print("Perimeter of the triangle is: ",p)
Algorithm:
- START
- Ask the user to enter the length of sides of triangle.
- Add them and store in a variable, say p.
- Display the value of p.
- STOP
Refer to the attachment for output ☑.
Attachments:
Similar questions