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

hi, in lecture 03 the tuple part, what did he change to make the tuple divisor script work?

OpenStudy (anonymous):

right, it's a comma after the i, ie (i,) anyone know why does there need to be a comma?

OpenStudy (anonymous):

there has to be a comma because it's a tuple assignment statement. For instance, when you assign a tuple initially, if you only want to put one value (say, 8) in it, you assign it t = 8, the way I think of it is that you're not trying to assign "the tuple" t the value 8. you're reassigning the tuple t to every element in it with the new element at the end. so if I'm using the tuple m, saying m+= 7, is like saying m = m[0],m[1],...7 the comma looks funny when you're only assigning one item, as in m = 7, but it's just a syntax rule that it has to be there.

OpenStudy (anonymous):

i understand now, 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!
Latest Questions
emaniscool35: why do I have ears?
4 seconds ago 12 Replies 0 Medals
Imagine: I hit level 50 so happy, did it in 4 days!
2 minutes ago 12 Replies 3 Medals
Imagine: Why should I never drop out of school?
4 minutes ago 18 Replies 1 Medal
izuwu1: do you think aliens exist, if so, why?
1 minute ago 24 Replies 2 Medals
emaniscool35: Tablet bath or laptop bath?
6 minutes ago 11 Replies 2 Medals
LakersForever865: What's Something You Want to Learn or Wish You Were Better At?
5 minutes ago 34 Replies 4 Medals
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!