Algorithms, functions, classes, regular expressions, iterators, generators, OOP, exceptions, NumPy, pandas, scikit-learn
https://telega.in/c/python_tasks
Questions — @dina_ladnyuk
Post #2040
1.8K
Даны 4 варианта кода:
# 1 вариант
list(filter((lambda x: x > 0) , range(-5, 5)))
# 2 вариант
res = []
for x in range(-5, 5):
if x > 0:
res.append(x)
print(res)
# 3 вариант
[х for х in range(-5, 5) if х > 0]
# 4 вариант
list(map(lambda x: x > 0, range(-10, 5)))