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

PS1: In part 1, I'm not sure how to do the final step. Specifically, how do I find the sum of each payment made in each successive step of the loop?

OpenStudy (e.mccormick):

You need to set some variable up outside the loop if to be able to add to it inside the loop. Each pass through the loop it adds to it.

OpenStudy (e.mccormick):

For example: ``` >>> x = 0 >>> for i in range(3): x = x + i print x 0 1 3 ```

OpenStudy (anonymous):

ah perfect, thank you!

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!