Vidyalelo
Python · Q38

Python Lists MCQs: Exam Practice for List Concepts

Programming · Python · question 38

Q38

What will be the output of the following Python code snippet? print([i+j for i in "abc" for j in "def"])

A.
['da', 'ea', 'fa', 'db', 'eb', 'fb', 'dc', 'ec', 'fc']
B.
[['ad', 'bd', 'cd'], ['ae', 'be', 'ce'], ['af', 'bf', 'cf']]
C.
[['da', 'db', 'dc'], ['ea', 'eb', 'ec'], ['fa', 'fb', 'fc']]
D.
['ad', 'ae', 'af', 'bd', 'be', 'bf', 'cd', 'ce', 'cf']
Answer

Answer: Option D

Solution

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