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

Lesson 3 (around 42:30): How to add elements in a tuple? I run the advised code but it doesn't add elements to the collection: http://codepad.org/g6bi8ise It returns: TypeError: can only concatenate tuple (not "int") to tuple

OpenStudy (anonymous):

http://dpaste.com/708363/

OpenStudy (anonymous):

u need to add the "," within the parentheses - like bwCA does in his code - for python to recognize you are adding to a tuple. this syntactical question has plagued many people so no worries

OpenStudy (anonymous):

or try smth like say if t=() and to add element use syntax t+=(2,)/Comma is important.

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!