for
loops are the bread and butter of imperative programming
and Python has some really nice tools to work with them.
If you want to traverse several structures in parallel,
have you considered using zip
?
Structural pattern matching is coming in Python 3.10 and
the previous Pydon't explored some interesting use cases
for the new match
statement.
This article explores situations for which match
isn't the answer.
Structural pattern matching is coming in Python 3.10 and this article
explores how to use it to write Pythonic code,
showing the best use cases for the match
statement.
Learn the ins and outs of comparison operator chaining, and especially the cases you should avoid.