Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 19 Online
OpenStudy (anonymous):

Hi, How Do I populate an empty tuple? Refer Problem Set 3 Thanks!

OpenStudy (anonymous):

NM, I got it!

OpenStudy (anonymous):

You cannot. Tuples are immutable, which means you cannot add, remove or change their contents in any way. You can however make a new, non-empty tuple and have your variable refer to the new one instead of the old one.

OpenStudy (anonymous):

you can make a list inside the tuple in the first declaration of a tuple and later you can add or 'nest' values and anything actually, but it will be inside the list/dictionnary depends on what you chose to do

OpenStudy (anonymous):

I made problem set 3 work by implementing it using lists. I think Professor Grimson was mistaken when he suggested changing the list to tuple in the divisor example during the lecture. I ran that example with tuples and it gave me the same error I had with problem set 3.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!