takes list of possible side lengths and determines whether a twodimensional polygon with such side lengths can exist returns a boolean value for the comparison of the largest side length with sum of the rest wiki https en wikipedia orgwikitriangleinequality checkpolygon6 10 5 true checkpolygon3 7 13 2 false checkpolygon1 4 3 5 2 12 2 false nums 3 7 13 2 checkpolygonnums run function do not show answer in output nums check numbers are not reordered 3 7 13 2 checkpolygon traceback most recent call last valueerror monogons and digons are not polygons in the euclidean space checkpolygon2 5 6 traceback most recent call last valueerror all values must be greater than 0 takes list of possible side lengths and determines whether a two dimensional polygon with such side lengths can exist returns a boolean value for the comparison of the largest side length with sum of the rest wiki https en wikipedia org wiki triangle_inequality check_polygon 6 10 5 true check_polygon 3 7 13 2 false check_polygon 1 4 3 5 2 12 2 false nums 3 7 13 2 _ check_polygon nums run function do not show answer in output nums check numbers are not reordered 3 7 13 2 check_polygon traceback most recent call last valueerror monogons and digons are not polygons in the euclidean space check_polygon 2 5 6 traceback most recent call last valueerror all values must be greater than 0
from __future__ import annotations


def check_polygon(nums: list[float]) -> bool:
    
    if len(nums) < 2:
        raise ValueError("Monogons and Digons are not polygons in the Euclidean space")
    if any(i <= 0 for i in nums):
        raise ValueError("All values must be greater than 0")
    copy_nums = nums.copy()
    copy_nums.sort()
    return copy_nums[-1] < sum(copy_nums[:-1])


if __name__ == "__main__":
    import doctest

    doctest.testmod()