In Python, what is the correct way to create a list?
-
A
(1, 2, 3)
-
B
[1, 2, 3]
Correct answer
-
C
{1, 2, 3}
-
D
<1, 2, 3>
Correct answer
B. [1, 2, 3]
14 views
Explanation
Lists are created with square brackets: [1, 2, 3]. Source: Standard Python content (FBISE-aligned).
Reference
Asked in: Matric,FBISE
Doubts & discussion
Not sure why the answer is B? Ask here and get an explanation.
Ask a doubt about this MCQ