Vidyalelo
Python · Q103

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 103

Q103

What will be the output of the following Python code? l1=[1,2,3] l2=[4,5,6] [x*y for x in l1 for y in l2]

A.
[4, 8, 12, 5, 10, 15, 6, 12, 18]
B.
[4, 10, 18]
C.
[4, 5, 6, 8, 10, 12, 12, 15, 18]
Answer
D.
[18, 12, 6, 15, 10, 5, 12, 8, 4]

Answer: Option C

Solution

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