File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change 1212> *** Then, the output should be:***
1313
1414```
15- 1,3,5,7,9
15+ 1,9,25,49,81
1616```
1717
1818----------------------
2323-------------------
2424** Main author's Solution: Python 2**
2525``` python
26- values = raw_input ()
27- numbers = [x for x in values.split(" ," ) if int (x)% 2 != 0 ]
28- print " ," .join(numbers)
26+ # # The solution by the author is incorrect.Thus it's not included here.
2927```
3028----------------
3129** My Solution: Python 3**
3230``` python
33- lst = [i for i in input ().split(' ,' ) if int (i) % 2 ]
31+ lst = [str ( int (i) ** 2 ) for i in input ().split(' ,' ) if int (i) % 2 ]
3432print (" ," .join(lst))
3533```
3634------------------------
3735
38- ** Solution by Amit: Python 3**
39- ``` python
40- x= input ().split(" ," )
41- ans= list (filter (lambda x : int (x)% 2 != 0 ,x))
42- print (" ," .join(ans))
43- ```
44-
4536# Question 17
4637
4738### ** Question:**
You can’t perform that action at this time.
0 commit comments