What Will Be The Output Of The Following Python Codep Pre #425
What will be the output of the following Python code?</p> <pre><code class="language-python">l1=[1,2,3] l2=[4,5,6] [x*y for x in l1 for y in l2]</code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 List Comprehension - Python List Comprehension - Quiz No.2.
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]
[4, 8, 12, 5, 10, 15, 6, 12, 18]
[4, 10, 18]
[4, 5, 6, 8, 10, 12, 12, 15, 18]
[18, 12, 6, 15, 10, 5, 12, 8, 4]