Reputation: 11
I currently have [x for x in if '' in x] for extraction but not sure what to add in
Upvotes: 0
Views: 44
Reputation: 34282
You can use a list comprehension with a condition, e.g:
[country for country, colours in flag_colours.items() if len(colours) > 2]
Upvotes: 7