Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 55 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
Raye14: What pfp should I use the pfps will bc in the comments
9 minutes ago 14 Replies 0 Medals
Jasonisyours: any tips on how to get better at art
22 minutes ago 9 Replies 3 Medals
zariahispretty: How Do I get my old account back if password not working
10 hours ago 9 Replies 1 Medal
Raye14: Why do people like to hurt me
4 hours ago 17 Replies 3 Medals
XQueenFAMARIX: WHO u choosing Polo G or LILTJAY ud83eudd14?
2 hours ago 14 Replies 0 Medals
JuneTheAssasin2923: Does anyone know anything about literary analyisis papers?
11 hours ago 8 Replies 1 Medal
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!