Skip to content

Commit 6c5e5eb

Browse files
committed
added python implementation
1 parent 485a370 commit 6c5e5eb

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

fp.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
def increment(n):
2+
return n + 1
3+
4+
5+
def my_objective(arr, f):
6+
for i in range(len(arr)):
7+
arr[i] = f(arr[i])
8+
return arr
9+
10+
11+
if __name__ == '__main__':
12+
arr = [0, 1, 2 , 3, 4]
13+
arr = my_objective(arr, increment)
14+
print(arr)

0 commit comments

Comments
 (0)