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

hi everybody i need help you. need modify a tuple. for example x=() i want add x=(1,2,3,4,5) for i in range(5): x=(i,)+x[i:] ???????

OpenStudy (anonymous):

tuples are immutable so you need to completely recreate it to add a value like this: x=() for i in range(5): x=x+(i,)

OpenStudy (lopus):

men thanks

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!