File tree Expand file tree Collapse file tree 1 file changed +29
-29
lines changed Expand file tree Collapse file tree 1 file changed +29
-29
lines changed Original file line number Diff line number Diff line change @@ -144,35 +144,6 @@ x.printString()
144
144
* * *
145
145
146
146
147
- ## Question_6: ##
148
- ** Description:**
149
-
150
- Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated\
151
- sequence after sorting them alphabetically.\
152
- Suppose the following input is supplied to the program:\
153
- * without,hello,bag,world
154
- Then, the output should be:\
155
- * bag,hello,without,world\
156
-
157
- ** Hints:**
158
- In case of input data being supplied to the question, it should be assumed to be a console input.
159
-
160
- ``` python
161
- def prog_3 ():
162
- x = input ()
163
- list_ = []
164
-
165
- for a in x.split(" ," ):
166
- list_.append(a)
167
- list_.sort()
168
- str_ = " ," .join(list_)
169
- print (list_)
170
- print (str_)
171
- return
172
- prog_3()
173
- ```
174
- * * *
175
-
176
147
## Question_6: ##
177
148
** Description:**
178
149
@@ -201,3 +172,32 @@ def two_dimens_arr(x, y):
201
172
two_dimens_arr(4 , 4 )
202
173
```
203
174
* * *
175
+
176
+ ## Question_7: ##
177
+ ** Description:**
178
+
179
+ Write a program that accepts a comma separated sequence of words as input and prints the words in a comma-separated\
180
+ sequence after sorting them alphabetically.\
181
+ Suppose the following input is supplied to the program:\
182
+ without,hello,bag,world
183
+ Then, the output should be:\
184
+ bag,hello,without,world\
185
+
186
+ ** Hints:**
187
+ In case of input data being supplied to the question, it should be assumed to be a console input.
188
+
189
+ ``` python
190
+ def prog_3 ():
191
+ x = input ()
192
+ list_ = []
193
+
194
+ for a in x.split(" ," ):
195
+ list_.append(a)
196
+ list_.sort()
197
+ str_ = " ," .join(list_)
198
+ print (list_)
199
+ print (str_)
200
+ return
201
+ prog_3()
202
+ ```
203
+ * * *
You can’t perform that action at this time.
0 commit comments