We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a978f35 commit 106a6b9Copy full SHA for 106a6b9
day33(Lambdafun).py
@@ -1,3 +1,4 @@
1
+#LAMBDA is anonymous function
2
# def double(x):
3
# return x*2
4
double=lambda x:x*2
@@ -14,3 +15,5 @@
14
15
def appl(fx,value):
16
return 6 +fx(value)
17
print(appl(cube,2))
18
+print(appl(lambda x:x*x*x,2))
19
+print(appl(lambda x:x*x,2))
day34(Map filter ).py
@@ -9,14 +9,14 @@
9
# for item in l:
10
# newl.append(cube(item))
11
# newl=list(map(cube,l)) # this is why map is used
12
-newl=list(map(lambda x:x*x*x,l)) # this is why map is used
+newl=list(map(lambda x:x*x*x,l)) # this is why lambda map is used
13
print(newl)
#FILTER higher order function
def filter_fun(a):
return a>2
-newnewl= list(filter(filter_fun,l))
+newnewl= list(filter(filter_fun,l)) #returns boolean
20
print(newnewl)
21
22
0 commit comments