+ 5

Consider the input file 'mbox.txt', extract the email-ids that belong to the lines starting with 'From'.

Consider the input file 'mbox.txt', extract the email-ids that belong to the lines starting with 'From'. Display all the email-ids, also tell which is the most popular mail-id.write a python code for this ? mbox.txt file contains lots of mails,extract email-ids

10th Oct 2017, 1:12 PM
sadiya zainab
sadiya zainab - avatar
5 Respuestas
+ 3
/*consider mbox.txt file ,extracts email-id's that start with 'From' & display the email ids that are most popular in descending order of their frequency. write a python code for this??*/ fh=open('mbox.txt') words=[] list=[] d=[] for line in fh: if line.startwith('From'): words=line.split() list.append(words[1]) for c in list: if c not in d: d[c]=1 else: d[c]+=1 c=0 for key in sorted(d,key=d.get,reserve=True): if c<=10: print(key,':',d[key]) c+=1 else: break @muhammad kamal
12th Oct 2017, 3:01 AM
sadiya zainab
sadiya zainab - avatar
+ 2
seriously I dunno if that's help or challenge 😭
12th Oct 2017, 6:20 AM
Muhammad Kamal
Muhammad Kamal - avatar
+ 2
its a challenge @muhammad kamal
12th Oct 2017, 1:55 PM
sadiya zainab
sadiya zainab - avatar
+ 1
Whats the edit:fail.xd??@muhammad kamal
13th Oct 2017, 12:24 PM
sadiya zainab
sadiya zainab - avatar
0
EDIT: Fail. xd
12th Oct 2017, 8:07 PM
Muhammad Kamal
Muhammad Kamal - avatar