From 5a0a9895f09d0b47393c088b1f59519fc8b0e7c5 Mon Sep 17 00:00:00 2001 From: Pravesh <cb.en.u4cse16234@cb.students.amrita.edu> Date: Wed, 19 Dec 2018 11:53:07 +0530 Subject: [PATCH] Upload New File --- CSE16234_ex3_q1.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CSE16234_ex3_q1.py diff --git a/CSE16234_ex3_q1.py b/CSE16234_ex3_q1.py new file mode 100644 index 0000000..90161c1 --- /dev/null +++ b/CSE16234_ex3_q1.py @@ -0,0 +1,11 @@ +path='/home/student4/sw.txt' +sw_file=open(path,'r') +d={} +occ=sw_file.readlines() +for i in occ: + if i in d: + d[i]+=1 + else: + d[i]=1 +print(d) + -- GitLab