as the title states, I want to find if integer i
is divisible by all elements in a list.
I have this:
db = [3, 4, 5, 6, 7, 8]
i = 1
if all(i % d != 0 for d in db):
i += 1
I tried using an if
loop with all()
, but it just skipped over that section even though the condition is met (I think). It should just add to the integer i
until it is divisible by 3, 4, 5, 6, 7,and 8.
Any tips or anything I'm doing wrong?
Thanks, Ben