Given def process(item): return item * item; items = [1, 2, 3, 4]; result = map(process, items); print(list(result)), what will be the output?
- [1, 2, 3, 4]
- [1, 4, 9, 16]
- [1, 8, 27, 64]
- [2, 4, 6, 8]
The map function applies the process function to each element in items, squaring each element. The output is [1, 4, 9, 16].
Loading...
Related Quiz
- ________ is a dimensionality reduction technique used in data mining to simplify complex, high-dimensional data.
- What is the purpose of the apply() function in R?
- In decision making, understanding the _______ of a decision helps in evaluating its long-term impacts.
- What is a common advantage of using cloud computing for data analysis compared to traditional on-premises solutions?
- The _______ theorem is a fundamental principle in probability theory that describes the distribution of sample means.