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

I tried (for fun) to combine two 'tuples' eg. (2,3)+(4,5) and it works. however if I have only one element on either tuple, eg. (2,3)+(4), it gives out error. anybody know how to solve this?

OpenStudy (anonymous):

The syntax for adding an element is (2,3) + (4,) as (4) just stands for the integer 4 surrounded by parentheses. Just a note, in case you didn't know: you are, in fact, creating a new tuple, rather than modifying an old one :-)

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!