adplus-dvertising
frame-decoration

Question

What is the output of the code shown below?
z=set('abc')
z.add('comp')
z.update(set(['p', 'q']))
z

a.

{‘abc’, ‘p’, ‘q’, ‘comp’}

b.

{‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘comp}

c.

{‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}

d.

{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘comp’}

Posted under Python

Answer: (d).{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘comp’}

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 the code shown below?