a = [ 3, 8, 2, 4, 5, 1, 6] b = [] for elem in a: if elem < 5: b.append(elem) print(b)