Write a function in python to search for details (Phone no and Calls) of those Phones which have more than 800 calls from file "phones".
# dictionary for frequency of each number
frequency = {}
# opening file
data = open('openfile.txt','r')
for line in data:
count = frequency.get(line,0)
frequency[line] = count + 1
# finding frequency of items
for i in frequency.items():
if frquency[i].key() >= 800:
print(frequency[i])
Comments
Leave a comment