references wikipedia square free number psfblack true ruff true doctest normalizewhitespace this functions takes a list of prime factors as input returns true if the factors are square free issquarefree1 1 2 3 4 false these are wrong but should return some value it simply checks for repetition in the numbers issquarefree1 3 4 sd 0 0 true issquarefree1 0 5 2 0 0 true issquarefree1 2 2 5 false issquarefree asd true issquarefree24 traceback most recent call last typeerror int object is not iterable doctest normalize_whitespace this functions takes a list of prime factors as input returns true if the factors are square free is_square_free 1 1 2 3 4 false these are wrong but should return some value it simply checks for repetition in the numbers is_square_free 1 3 4 sd 0 0 true is_square_free 1 0 5 2 0 0 true is_square_free 1 2 2 5 false is_square_free asd true is_square_free 24 traceback most recent call last typeerror int object is not iterable
from __future__ import annotations


def is_square_free(factors: list[int]) -> bool:
    
    return len(set(factors)) == len(factors)


if __name__ == "__main__":
    import doctest

    doctest.testmod()