I almost never use map or filter but it's good to know how they work. I use list comprehensions all the time though.
map
filter
A tip: you don't need to call list() on an iterable, unless you have a good reason to (like to print it as an example) you can just... iterate it :)
list()
This is a good intro on "functional Python": Functional Programming HOWTO
I predominantly use comprehensions as well, I actually completely forgot you could just iterate the objects so good call! I'm going to update this.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I almost never use
maporfilterbut it's good to know how they work. I use list comprehensions all the time though.A tip: you don't need to call
list()on an iterable, unless you have a good reason to (like to print it as an example) you can just... iterate it :)This is a good intro on "functional Python": Functional Programming HOWTO
I predominantly use comprehensions as well, I actually completely forgot you could just iterate the objects so good call! I'm going to update this.