Home .net : removing a particular dictionary from list of dictionaries and returning only distinct list of dictionaries
Reply: 0

.net : removing a particular dictionary from list of dictionaries and returning only distinct list of dictionaries

prudhvikumar reddy
1#
prudhvikumar reddy Published in 2018-02-14 09:15:40Z

l1 = [{'key1':'value1','key2':'value2'}, {'key1':'value1','key2':'value2'}, ... ] Now what I want is to remove a dictionary from this list by checking first/second key and its value. I can check whether a whole dictionary is present in the list and then remove it. But I just want to check whether a dictionary with a particular first/second key is present or not in the list. And I want to remove that dictionary from this list subsequently. How do I do that?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.317153 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO