Given the length of 3 sides of a triangle, check whether the triangle is valid or not. Python

Posted on | Sunday, 14 May 2023 | No Comments

 Given the length of 3 sides of a triangle, check whether the triangle is valid or not.

Input Format

First and only line of input contains three integers A, B, C - length of sides of the triangle.

Constraints

1 <= A, B, C <= 109

Output Format

Print "Yes" if you can construct a triangle with the given three sides, "No" otherwise.

Sample Input 0

4 3 5

Sample Output 0

Yes
x,y,z=map(int,input().split())
if x<(z+y) and y<(x+z) and z<(x+y):
    print("Yes")
else:
    print("No")

Comments

Leave a Reply

Search

Followers