adplus-dvertising
frame-decoration

Question

What is the output of the code shown below?
a=set('abc')
b=set('def')
b.intersection_update(a)
a
b

a.

set()
(‘e’, ‘d’, ‘f’}

b.

{}
{}

c.

{‘b’, ‘c’, ‘a’}
set()

d.

set()
set()

Posted under Tuples and Sets Python

Answer: (c).{‘b’, ‘c’, ‘a’}
set()

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?