Apr-16-2020, 09:18 PM
Maybe run two loops: one for the number to check, one for the division test.
max_check = 10000 dividends = [3, 4, 7, 5, 6, 8, 9] for n in range(1,max_check): for dividend in dividends: if n % dividend: break else: print(f"{n} is evenly divided by {dividends}") break else: print(f"No numbers found evenly divisible by {dividends} that are less than {max_check}")