Vidyalelo
Python · Q124

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 124

Q124

Write a list comprehension to produce the list: [1, 2, 4, 8, 16......212].

A.
[(2**x) for x in range(0, 13)]
Answer
B.
[(x**2) for x in range(1, 13)]
C.
[(2**x) for x in range(1, 13)]
D.
[(x**2) for x in range(0, 13)]

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board