Write a Python program to enter two angles of a triangle and find the third angle.

PROGRAM

# Python program to find the third angle of a triangle (no if-else)
# Input two angles from the user
angle1 = float(input(“Enter the first angle of the triangle: “))
angle2 = float(input(“Enter the second angle of the triangle: “))
# Calculate third angle
angle3 = 180 – (angle1 + angle2)
# Display the result
print(f”The third angle of the triangle is: {angle3} degrees”)

OUTPUT

TRY THE ABOVE CODE

Leave a Reply

Your email address will not be published. Required fields are marked *

sign up!

We’ll send you the hottest deals straight to your inbox so you’re always in on the best-kept software secrets.