Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 5
you can eliminate "and" like:
[print(i*j) for i in range(5) for j in range(6,10) if j*i%3!=0]
+ 2
Bahha🐧 and 'j*i%3!=0' is simply equal to 'j*i%3', since booleans are integers!
+ 2
+ 1
Actually, I don't think this expression is shorter, but is this what you're looking for?
[ print(i*j) for i in range(5) for j in range(6,10) if all(x%3!=0 for x in [i, j]) ]