diff --git a/u2/list_ops.py b/u2/list_ops.py index 72b4ca4..43fcd5f 100644 --- a/u2/list_ops.py +++ b/u2/list_ops.py @@ -1,8 +1,4 @@ -def length(l): - count = 0 - for item in l: - count +=1 - return count + def append(list1, list2): result = [] @@ -12,3 +8,21 @@ def append(list1, list2): result += [item] return result +def concat(lists): + result = [] + for sublist in lists + result = append(result, sublist) + return result + +def filter(function, list): + result = [] + for item in list: + if function(item): + result += [item] + return result + +def length(l): + result = 0 + for item in l: + result +=1 + return result \ No newline at end of file