Search for specific value in list of dictionaries and return the Index
Searching list of dictionaries : Let’s define a list of dictionaries for our operations.
1 |
list_of_dict = [{'expires': '1800', 'timestamp': '2017-10-04 13:59:09', 'fromUser': 'sip:5545@1.5.7.23:5060', 'callID': '42259bfc-506d3c0e-59d4e928@1.5.2.23'}, {'expires': '1800', 'timestamp': '2017-10-04 13:59:09', 'fromUser': 'sip:5545@19.9.7.29:5060', 'callID': '42259bfc-506d3c0e-59d4e928@19.9.7.29'}, {'expires': '120', 'timestamp': '2017-10-04 13:59:38', 'fromUser': 'sip:ast@19.9.7.7', 'callID': '389c0af66b44f30469eab6793fa4b61b@19.9.7.29'} |
Now I want to search for callID ...