News

One well-known benefit of using mapping types such as dictionaries is that the searching is very fast compared to a sequential lookup as in the above if - elif - else statements or using a for loop, ...
While Python has lacked a native syntax for pattern matching, it has been possible to emulate it with if/elif/else chains or a dictionary lookup.