-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha5.py
More file actions
39 lines (35 loc) · 881 Bytes
/
a5.py
File metadata and controls
39 lines (35 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# list1=list() # this is for list
# # list1=[5, 3 , 6] # list:[]
# print(list1)
# list1.append(5)
# print(list1)
# list1.append(8)
# print(list1)
# jjj=dict() # this is for dictionary
# print(jjj)
#
# jjj={'jan':10, 'feb':2, 'april':4} # dictionary:{}
# print(jjj)
#
# # jjj.apend('may':5)
# jjj['may']=5
# print(jjj)
# print(jjj['may'])
# counts=dict() # this is for dictionary
# month=['jan', 'feb', 'april', 'may'] # this is for list
# print(month)
# for i in month:
# print(i)
# if i not in counts:
# counts[i]=1
# else:
# counts[file_name] = 1+ counts[file_name]
# print(counts)
counts=dict() # this is for dictionary
month=['feb','april', 'jan', 'feb', 'april', 'may'] # this is for list
print(month)
month=sorted(month)
print(month)
for i in month:
counts[i]=counts.get(i,0)+1
print(counts)