def prime_factors(num: int) -> list:
    """
    returns a list of prime factors of a number
    :param num: the number to get the prime factors of
    :return: list of prime factors

    Example:
        >>> prime_factors(12)
        >>> [2, 2, 3]

    """
    factors = []
    i = 2
    while i * i <= num:
        if num % i:
            i += 1
        else:
            num //= i
            factors.append(i)
    if num > 1:
        factors.append(num)
    return factors