These questions assess a students understanding of the list comprehension concept map.
True for all elements of the container.None equal in length of the container.def square(z):
return z * z
def is_number(z):
from numbers import Number
return isinstance(z, Number)
items = [1, '4', 9, 16.1, [1, 2, 3]]
Write a list comprehension that squares only the numeric elements of items.