Skip to content

Commit e0c3fa7

Browse files
committed
[Feat] Add Solutions of saxenaharsh24
Branch: master
1 parent 96a61c4 commit e0c3fa7

File tree

3 files changed

+54
-12
lines changed

3 files changed

+54
-12
lines changed

Status/Day_11.md

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ for i in range(5,10):
5151
print(lst1)
5252
print(lst2)
5353
```
54-
55-
**OR**
54+
----
5655

5756
```python
5857

@@ -67,8 +66,6 @@ print(tup[:lt], tup[lt:])
6766

6867
---
6968

70-
**OR**
71-
7269
```python
7370

7471
'''
@@ -84,6 +81,15 @@ print('The Original Tuple:',tp)
8481
```
8582

8683
---
84+
```python
85+
86+
'''
87+
Solution by: saxenaharsh24
88+
'''
89+
90+
tup = [i for i in range(1, 11)]
91+
print(f'{tuple(tup[:5])} \n{tuple(tup[5:])}')
92+
```
8793

8894
# Question 39
8995

@@ -227,7 +233,18 @@ li = [1,2,3,4,5,6,7,8,9,10]
227233
squaredNumbers = map(lambda x: x**2, li) # returns map type object data
228234
print(list(squaredNumbers)) # converting the object into list
229235
```
236+
---
237+
```python
238+
'''
239+
Solution by: saxenaharsh24
240+
'''
241+
def sqrs(item):
242+
return item ** 2
243+
230244

245+
lst = [i for i in range(1, 11)]
246+
print(list(map(sqrs, lst)))
247+
```
231248
---
232249

233250
# Question 42
@@ -267,7 +284,19 @@ li = [1,2,3,4,5,6,7,8,9,10]
267284
li = map(squer,filter(even,li)) # first filters number by even number and the apply map() on the resultant elements
268285
print(list(li))
269286
```
287+
---
288+
```python
289+
"""
290+
Solution by: saxenaharsh24
291+
"""
292+
def even(item):
293+
if item % 2 == 0:
294+
return item**2
270295

296+
297+
lst = [i for i in range(1, 11)]
298+
print(list(filter(lambda j: j is not None, list(map(even, lst)))))
299+
```
271300
---
272301

273302
# Question 43

Status/Day_20.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,20 @@ print(li)
157157
```
158158
---
159159
```python
160-
'''Solution by: popomaticbubble
161-
'''
160+
"""Solution by: popomaticbubble
161+
"""
162162
orig_list = [12,24,35,70,88,120,155]
163163
new_list = [i for (j, i) in enumerate(orig_list) if j not in range(1,4)]
164164
print(new_list)
165165
```
166166
---
167-
167+
```python
168+
"""Solution by: saxenaharsh24
169+
"""
170+
lst = [12,24,35,70,88,120,155]
171+
print([i for i in lst if lst.index(i) not in range(2,5)])
172+
```
173+
---
168174
# Question 84
169175

170176
### **Question**

Status/Day_23.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ if __name__ == '__main__':
128128
129129
---
130130
```python
131-
'''Solution by: mishrasunny-coder
132-
'''
131+
"""Solution by: mishrasunny-coder
132+
"""
133133
import textwrap
134134

135135
string = input()
@@ -139,16 +139,23 @@ print(textwrap.fill(string,width))
139139
```
140140
---
141141
```python
142-
'''solution by : Prashanth
143-
'''
142+
"""solution by : Prashanth
143+
"""
144144
from textwrap import wrap
145145
x = str(input(': '))
146146
w = int(input())
147147
z = list(wrap(x, w))
148148
for i in z:
149149
print(i)
150150
```
151-
151+
---
152+
```python
153+
"""solution by : saxenaharsh24
154+
"""
155+
import textwrap
156+
string = input('')
157+
print('\n'.join(textwrap.wrap(string, width= int(input('')))))
158+
```
152159
---
153160
# Question 97
154161

0 commit comments

Comments
 (0)