jl = [] for i in range(10): jl.append(i) if len(jl) > 3: jl = [] print(jl)