Skip to content

Commit f0b48e5

Browse files
committed
third commit
1 parent e61c203 commit f0b48e5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎advanced_python.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
'''def is_even(number):
1+
# A function to return even numbers from a list using "filter"
2+
def is_even(number):
23
return number % 2 == 0
34
numbers = [1,56,234,87,4,76,24,69,90,135]
45
print(list(filter(is_even,numbers)))
56

6-
7+
#using lamba to return odd figures from the list below
78
numbers = [1,56,234,87,4,76,24,69,90,135]
89
print(list(filter(lambda x : x % 2 == 1,numbers)))
910

10-
from functools import *
11-
11+
#A function to add strings
1212
def fold(words):
1313
i=0
1414
z = ""
@@ -18,7 +18,7 @@ def fold(words):
1818

1919
print(z)
2020

21-
fold(["hello" , "world"])'''
21+
fold(["hello" , "world"])
2222

2323
# printing out a list of positive numbers from this list(numbers)
2424
numbers = [34.6, -203.4, 44.9, 68.3, -12.2, 44.6, 12.7]

0 commit comments

Comments
 (0)