Dictionary 2

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
40
41
42
43
44
45
46
47
48
49
50
  : 29
, : 4
– : 1
. : 2
a : 24
b : 2
c : 7
d : 11
e : 19
f : 2
g : 8
h : 3
i : 15
j : 1
l : 8
m : 15
n : 17
o : 11
p : 11
r : 17
s : 11
t : 16
u : 7
v : 2
y : 7
 
 
s1 = “Python features a dynamic type system and automatic”
s1+=“memory management and supports multiple programming “
s1+=“paradigms, including object-oriented, imperative, functional “
s1+=“programming, and procedural styles. “
s1+=“It has a large and comprehensive standard library.” 
 
 
dic = {}
 
chList = list(set(list(s1.lower())))
chList.sort()
for x in chList:
    dic[x] = s1.count(x)
 
 
for key, val in dic.items():
    print(“%s : %d” % (key, val)) 
 
 
cs

Leave a comment