6
Loading subject content…
Loading subject content…
Loading practice questions…
What is the output of the following code?
from functools import reduce
print(reduce(lambda a, b: a * b, [1, 2, 3, 4]))What is the output of the following code?
fs = [lambda: i for i in range(3)]
print([f() for f in fs])What is the output of the following code?
words = ['pear', 'fig', 'banana']
print(sorted(words, key=len))What is the output of the following code?
for i, ch in enumerate('ab', start=1):
print(i, ch, end=' ')