@@ -37,13 +37,26 @@ print '\n'.join(['%s,%s' % (k, v) for k, v in dic.items()])
3737----------------
3838** My Solution: Python 3**
3939``` python
40- # to be written
40+ import string
4141
42+ s = input ()
43+ for letter in string.ascii_lowercase:
44+ cnt = s.count(letter)
45+ if cnt > 0 :
46+ print (" {} ,{} " .format(letter,cnt))
47+ ```
48+ ** OR**
49+ ``` python
50+ s = input ()
51+ for letter in range (ord (' a' ),ord (' z' )+ 1 ): # ord() gets the ascii value of a char
52+ letter = chr (letter) # chr() gets the char of an ascii value
53+ cnt = s.count(letter)
54+ if cnt > 0 :
55+ print (" {} ,{} " .format(letter,cnt))
4256```
4357---------------------
4458
4559
46-
4760# Question 91
4861
4962### ** Question**
@@ -73,8 +86,9 @@ print s
7386----------------
7487** My Solution: Python 3**
7588``` python
76- # to be written
77-
89+ s = input ()
90+ s = ' ' .join(reversed (s))
91+ print (s)
7892```
7993---------------------
8094
@@ -107,8 +121,18 @@ print s
107121----------------
108122** My Solution: Python 3**
109123``` python
110- # to be written
111-
124+ s = " H1e2l3l4o5w6o7r8l9d"
125+ s = [ s[i] for i in range (len (s)) if i% 2 == 0 ]
126+ print (' ' .join(s))
127+ ```
128+ ** OR**
129+ ``` python
130+ s = " H1e2l3l4o5w6o7r8l9d"
131+ ns = ' '
132+ for i in range (len (s)):
133+ if i % 2 == 0 :
134+ ns+= s[i]
135+ print (ns)
112136```
113137---------------------
114138
@@ -125,20 +149,13 @@ print s
125149
126150----------------------
127151
128- ** Main author's Solution: Python 2 **
152+ ** Solution:**
129153``` python
130154
131155import itertools
132156print list (itertools.permutations([1 ,2 ,3 ]))
133157```
134158----------------
135- ** My Solution: Python 3**
136- ``` python
137- # to be written
138-
139- ```
140- ---------------------
141-
142159
143160
144161# Question 94
@@ -155,7 +172,7 @@ We count 35 heads and 94 legs among the chickens and rabbits in a farm. How many
155172
156173----------------------
157174
158- ** Main author's Solution: Python 2 **
175+ ** Solution:**
159176``` python
160177def solve (numheads ,numlegs ):
161178 ns= ' No solutions!'
@@ -171,11 +188,3 @@ solutions=solve(numheads,numlegs)
171188print solutions
172189```
173190----------------
174- ** My Solution: Python 3**
175- ``` python
176- # to be written
177-
178- ```
179- ---------------------
180-
181-
0 commit comments