Update u2/list_ops.py
This commit is contained in:
parent
d731d5db90
commit
8f70c5255c
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
def append(list1, list2):
|
def append(list1, list2):
|
||||||
result = []
|
result = []
|
||||||
for item in list1:
|
for item in list1:
|
||||||
@ -25,3 +24,13 @@ def length(l):
|
|||||||
for item in l:
|
for item in l:
|
||||||
result +=1
|
result +=1
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def map(function, list):
|
||||||
|
|
||||||
|
|
||||||
|
def foldl(function, list, initial):
|
||||||
|
|
||||||
|
|
||||||
|
def foldr(function, list, initial):
|
||||||
|
|
||||||
|
def reverse(list):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user