Normally, to access multiple indices from a list, you need to use list comprehension. To do the same thing with simpler syntax, use operator.itemgetter instead.
operator.itemgetter
Link to other tips on Python’s built-in libraries.
Python-Magic: Reliable File Type Detection Beyond Extensions
Hydra: YAML-Based Config Management Made Simple
Loguru: Configure Professional Logging in a Single Line
Your email address will not be published. Required fields are marked *
Name
Email
Website
Save my name, email, and website in this browser for the next time I comment.
Δ