isprime product

Run Settings
LanguagePython
Language Version
Run Command
def isprime(num): if num == 1: return True else: return factors(num) == [1,num] def factors(n): fact = [] for i in range(1,n+1): if n%i == 0: fact.append(i) return fact def primeproduct(num): factors = [] for i in range(1,num+1): if isprime(i) and num%i == 0 : factors.append(i) res = 1 for i in factors: res *= i if (res == num): return True return False print(primeproduct(202))
Editor Settings
Theme
Key bindings
Full width
Lines