In: Computer Science
(Triangle Inequality) Write a program triangle.py that takes three integers as command-line arguments and writes True if each one of them is less than or equal to the sum of the other two and False otherwise. This computation tests whether the three numbers could be the lengths of the sides of some triangle.
$ python3 triangle.py
3
4
5
True
$ python3 triangle.py
2
4
7
False
Thanks for the question.
Below is a simple code you will be needing Let me know if you
have any doubts or questions.
Thank You !!
===========================================================================
side_one = float(input('Enter side 1: ')) side_two = float(input('Enter side 2: ')) side_three = float(input('Enter side 3: ')) sum_one_two = side_one + side_two sum_one_three = side_one + side_three sum_two_three = side_two + side_three if sum_one_two < side_three or sum_one_three < side_two or sum_two_three < side_one: print(False) else: print(True)