infile=infile.strip(" ")
count_dict={}
alist=[]
alist=infile.split()
for lastname in alist:
if lastname not in count_dict:
count_dict[last]=1
else:
count_dict[number]=count_dict[number]+1
*This part counts the occurrences in the file and places them in the dictionary
for line in infile:
line=line.strip()
if len(line) and line[0]!="-":
lst=line.split(",")
lastname=lst[0].strip()
*This part reads the file lines
Ive tried many ways to put them together but I keep getting an error, can I get some help!

New Topic/Question
Reply



MultiQuote



|