This functions takes a list of prime factors as input. returns True if the factors are square free.
(factors)
| 1 | def is_square_free(factors): |
| 2 | """ |
| 3 | This functions takes a list of prime factors as input. |
| 4 | returns True if the factors are square free. |
| 5 | """ |
| 6 | for i in factors: |
| 7 | if factors.count(i) > 1: |
| 8 | return False |
| 9 | return True |
| 10 | |
| 11 | |
| 12 | def prime_factors(n): |
no test coverage detected