9 lines
168 B
Python
9 lines
168 B
Python
i = [2, 4, 6, 8 , 10 ]
|
|
|
|
# List comprehension
|
|
test = [x * 2 for x in i]
|
|
# lampda function
|
|
lam_test = list(map(lambda x: x * 3, i))
|
|
print(i)
|
|
print(test)
|
|
print(lam_test) |