Hi, How Do I populate an empty tuple? Refer Problem Set 3 Thanks!
NM, I got it!
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.
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
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.
Join our real-time social learning platform and learn together with your friends!