From df5674954ac620171391f37b4d8b903519d4abfa Mon Sep 17 00:00:00 2001 From: D Vengatesh <cb.en.u4cse16261@cb.students.amrita.edu> Date: Wed, 19 Dec 2018 11:55:14 +0530 Subject: [PATCH] files q1 done --- CSE16261_Ex03_01_.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 CSE16261_Ex03_01_.py diff --git a/CSE16261_Ex03_01_.py b/CSE16261_Ex03_01_.py new file mode 100644 index 0000000..e20973c --- /dev/null +++ b/CSE16261_Ex03_01_.py @@ -0,0 +1,14 @@ +path='sw.txt' + +sample_txt=open(path,'r') +dic={} +text=sample_txt.readlines() +for i in text : + if i not in dic : + dic[i]=1 + else : + dic[i]+=1 + +print(dic) + + -- GitLab