Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def is_triangle(a, b, c):
- sides = [a, b, c]
- for x, y, z in sides:
- if x + y < z:
- return False
- if abs(x - y) > z:
- return False
- for side in sides:
- if side <= 0:
- return False
- return True
- print(is_triangle(7, 2, 2))
Advertisement
Add Comment
Please, Sign In to add comment