-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha6.py
More file actions
29 lines (26 loc) · 733 Bytes
/
a6.py
File metadata and controls
29 lines (26 loc) · 733 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
# counts=dict()
# file1=open('romeo.txt')
# print(file1)
# file2='romeo.txt'
# print(file2)
# words=file2.split()
# print(words)
# tt=type(file1)
# print(tt)
# counts=dict()
# line=input('enter file file_name: ') #enter 'romeo.txt'
# words=line.split()
# print('total words:', words)
# for i in words:
# counts[i]=counts.get(i,0)+1
# print('total countL:',counts)
# ff={'jan':10, 'feb':2, 'april':4} # dictionary:{}
# for i in ff:
# print(i, ff[i])
# print(list(ff))
# print(ff.keys())
# print(ff.values())
# print(ff.items()) # keys & values
# ff={'jan':10, 'feb':2, 'april':4} # dictionary:{}
# for aaa,bbb in ff.items(): # aaa & bbb represents key, value respectively
# print(aaa,bbb)