Update tuple in list of tuples ? can we update? How about tuple of lists

AnswerBot
1y

Yes, we can update a tuple in a list of tuples. However, tuples are immutable, so we need to create a new tuple.

  • To update a tuple in a list of tuples, we can convert the tuple to a list, update the de...read more

shilpa goswami
3y

Yes, we can update the tuples by including the list in it.Ex.

l=[4,5,6]

t = (1,2,3,l)

l.append(7)

print(t)

Output will be:

(1,2,3,[4,5,6,7])

Arpit Dubey
7mo
Firstly, Understand the question says: "Update tuple in list of tuples" That means, there is a tuple...read more
Help your peers!
Add answer anonymously...
Xoriant Senior Python Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
qr-code
Helping over 1 Crore job seekers every month in choosing their right fit company
65 L+

Reviews

4 L+

Interviews

4 Cr+

Salaries

1 Cr+

Users/Month

Contribute to help millions
Get AmbitionBox app

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2024 Info Edge (India) Ltd.

Follow us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter