Question 1
Which of the following is a valid use case for a list comprehension in python?
Question 2
What is the result of the following list comprehension in python?
[word.upper () for word in [hello, world]]
Question 3
Can you nest list comprehensions in python?
Question 4
What is list comprehension in python?
Question 5
What does the following list comprehension do in python?
[ x for x in range(1, 6) ]
Question 6
What does the following list comprehension do in python?
[ (x, y) for x in range(3) for y in range(3) ]
Question 7
What will be the result of the following list comprehension in python?
[ x for x in range(1, 10) if x % 2 == 0 ]
Question 8
Which symbol is used to define a list comprehension in python?
Question 9
How can you add a conditional statement to a list comprehension in python?
Question 10
How can you square all the elements in a list using a list comprehension?