Problem 3: Is Triangle? (100pts)
Write a function that takes three integers (may be nonpositive) and returns True
if the three integers can form the three sides of a triangle, otherwise returns False
.
def is_triangle(a, b, c):
"""Given three integers (may be nonpositive), judge whether the three
integers can form the three sides of a triangle.
>>> is_triangle(2, 1, 3)
False
>>> is_triangle(5, -3, 4)
False
>>> is_triangle(2, 2, 2)
True
"""
pass # YOUR CODE HERE
Test your implementation with
python ok -q is_triangle
.