SyntaxFix
Write A Post
Hire A Developer
Questions
For anyone using Python 3.8 or newer I recommend using "Assignment Expressions" as described in PEP 572 -- Assignment Expressions.
if any((match := i) > 3 for i in range(10)): print(match)