Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 13 Online
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
Graysonunderwoods: Have you even been beaten by a wet spaghetti noodle by your girlfriend because sh
26 minutes ago 48 Replies 1 Medal
AsianPanda08: What should i eat for dinner tonight? I can't choose
2 hours ago 51 Replies 2 Medals
Nina001: Trying 2 figure out what is the square root of 8746685
58 minutes ago 30 Replies 2 Medals
SnowyBreaks: Is it bad to lose 3.8 pounds in less than 2 days?
1 hour ago 43 Replies 0 Medals
kaelynw: tried a lil smt, the arm is off but i like the other stuff
42 minutes ago 15 Replies 2 Medals
laylasnii13: Who wanna write or make a song with me???
5 hours ago 8 Replies 0 Medals
kaelynw: art igg
14 hours ago 13 Replies 2 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!