[Solved] Python giving me an error for trying to mod two variables


Your current approach won’t work for the time constraint – it’ll just take too long to complete.

Try this code first and figure out what’s the trick to save computing time.

primes = [2,3,5,7,11,13,17,19]
prod = 1

for p in primes:
    n = 2
    prod *= p
    while (p**n < 21):
        prod *= p
        n += 1
print(prod)   # 232_792_560

solved Python giving me an error for trying to mod two variables