From 791e8629d1f7802c6de629241a46d3e3b201e385 Mon Sep 17 00:00:00 2001 From: Marege Date: Tue, 29 Sep 2026 18:13:25 +0200 Subject: [PATCH] Fix1 --- u2/list_ops_test.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/u2/list_ops_test.py b/u2/list_ops_test.py index f14f091..b67ac83 100644 --- a/u2/list_ops_test.py +++ b/u2/list_ops_test.py @@ -1,14 +1,15 @@ def append(list1, list2): - a = list1 - b = list2 - return a + b + a = list(list1) + b = list(list2) + c = list(a + b) + return c """Vráti nový zoznam obsahujúci všetky prvky list1, po ktorých nasledujú všetky prvky list2.""" pass def concat(lists): + result = [] for i in lists: - result = [] result += i return result """Spojí zoznamy obsiahnuté v lists do jedného zoznamu. @@ -17,10 +18,12 @@ def concat(lists): def filter(function, seq): + result = [] for i in seq: - if function(i): - result = [] + if function(i) == True: result.append(i) + else: + continue return result """Vráti nový zoznam s tými prvkami, pre ktoré volanie function(element) vráti True.""" pass @@ -29,7 +32,7 @@ def filter(function, seq): def length(seq): a = 0 for i in seq: - a += 1 + i #xz + a += 1 return a """Vráti počet prvkov v zozname.""" pass