Reputation: 3766
Say I have a list of strings, and I want to filter out all non-upper case strings. Is there a simpler way than doing filter(lambda x: x.isupper(), list)?
Upvotes: 0
Views: 142
Reputation: 2167
While I would prefer a list comprehension, this seems to be what you're looking for:
filter(str.isupper, list)
Upvotes: 10