Skip to content

Commit 0ad4796

Browse files
committed
update program of 19th day
1 parent b1270fe commit 0ad4796

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

019-day/Program37.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,20 @@
22
#Higher order function is called a function that take a function as parameter and perform that function inside the function and return the result
33

44
#State
5-
#Each Object/Instance have their on property value. This property value is call State.
5+
#Each Object/Instance have their on property value. This property value is call State.
6+
7+
#Example of higher order function
8+
9+
def add(x,y):
10+
return x + y
11+
12+
def multiply(x,y):
13+
return x * y
14+
15+
def calculator(x, y, func):
16+
return func(x,y)
17+
18+
print(calculator(3,2,add))
19+
print(calculator(10,5, multiply))
20+
21+
#In the above `calculator` function is the higher order function

0 commit comments

Comments
 (0)