Skip to content

Commit ba74427

Browse files
authored
Update Day 5.md
1 parent 5c0a334 commit ba74427

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

Status/Day 5.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
>***Then, the output should be:***
1313
1414
```
15-
1,3,5,7,9
15+
1,9,25,49,81
1616
```
1717

1818
----------------------
@@ -23,25 +23,16 @@
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]
3432
print(",".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:**

0 commit comments

Comments
 (0)