adplus-dvertising
frame-decoration

Question

What is the output of each of the functions shown below?
{x for x in 'abc'}
{x*3 for x in 'abc'}

a.

{abc}
aaa
bbb
ccc

b.

abc
abc abc abc

c.

{‘a’, ‘b’, ‘c’}
{‘aaa’, ‘bbb’, ‘ccc’}

d.

{‘a’, ‘b’, ‘c’}
abc
abc
abc

Posted under Python

Answer: (c).{‘a’, ‘b’, ‘c’}
{‘aaa’, ‘bbb’, ‘ccc’}

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of each of the functions shown below?