I\'ve recently been working on Project Euler problems in Python. I am fairly new to Python, and still somewhat new as a programmer.
In any case, I\'ve ran into a sp
List comprehensions are faster than for loops.
Do something like this to check a number:
def get_divs(n): divs = [x for x in range(1,20) if n % x == 0] return divs
You can then check the length of the divs array to see if all the numbers are present.