Reputation: 2072
How do I make the below code neater
if integer % 2 == 0 or integer % 3 == 0 or ... integer % 9 == 0:
edit:
I am trying to check whether the variable integer
is fully (i.e. there is no remainder after the division) divisible by any of the following integers: [2,3,4,5,6,7,8,9]
. And I was wondering whether there is a better way to write that if statement.
Upvotes: 1
Views: 95