Generator expressions Python – stackoverflow.com

I have a list of dictionaries like the following: lst = [{'a': 5}, {'b': 6}, {'c': 7}, {'d': 8}] I wrote a generator expression like: next((itm for itm in lst if itm['a']==5)) Now the strange part ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Generator expressions Python – stackoverflow.com"