I've searched for the switch statement in Python and found that it does not exist.
Instead, it's called the match operator, which has been available since Python 3.10.
This solution is very clear using the match operator, and it also uses string interpolation and collection destructuring/unpacking.
I've trained again on this kata to type and feel for myself the functioning of this operator.
Simply and beautiful code.
love this one. perfect balance of readability and conciseness imo
So good to read! I learnt some new from this code :D
Thanks!
Very readable!
I've searched for the switch statement in Python and found that it does not exist.
Instead, it's called the match operator, which has been available since Python 3.10.
This solution is very clear using the match operator, and it also uses string interpolation and collection destructuring/unpacking.
I've trained again on this kata to type and feel for myself the functioning of this operator.