Skip to content
Snippets Groups Projects
Commit e91ddaa0 authored by K V Ragul's avatar K V Ragul
Browse files

lab 3

parent 60d675c0
No related branches found
No related tags found
No related merge requests found
path='/home/student4/sun.txt'
sun_file=open(path,'r')
categories = {}
line = sun_file.readline().strip().split("/sun_")
category = line[0][3:]
while len(category)>0:
if category in categories.keys():
categories[category]+=1
else:
categories[category]=1
line = sun_file.readline().strip().split("/sun_")
category = line[0][3:]
print(categories)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment