I am wondering if I can do this, it's for a Reddit bot
submission = next(x for x in memes_submissions if not x.over_18 if not x.stickied)
I am wondering if I can do this, it's for a Reddit bot
submission = next(x for x in memes_submissions if not x.over_18 if not x.stickied)
Use and
or or
to combine conditions.
submission = next(x for x in memes_submissions if not x.over_18 and not x.stickied)