16 lines
483 B
Python
16 lines
483 B
Python
# Question: Write a Python program to accept three sides and check whether they form a valid triangle.
|
|
|
|
def main(sides: tuple[int, int, int]) -> None:
|
|
a, b, c = sides
|
|
if a + b > c and a + c > b and b + c > a:
|
|
print(f"The sides {sides} form a valid triangle.")
|
|
else:
|
|
print(f"The sides {sides} do not form a valid triangle.")
|
|
|
|
if __name__ == '__main__':
|
|
main((3, 4, 5))
|
|
main((1, 2, 3))
|
|
main((5, 12, 13))
|
|
main((7, 10, 5))
|
|
main((1, 1, 2))
|