adplus-dvertising
frame-decoration

Question

Is the following piece of code valid?
>>> a=(1,2,3)
>>> b=a.update(4,)

a.

Yes, a=(1,2,3,4) and b=(1,2,3,4)

b.

Yes, a=(1,2,3) and b=(1,2,3,4)

c.

No because tuples are immutable

d.

No because wrong syntax for update() method

Posted under Python

Answer: (c).No because tuples are immutable

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Is the following piece of code valid?