Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 14 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!
Latest Questions
Jalissa21: What does adenoma mea?
52 minutes ago 2 Replies 0 Medals
Twilightt: How Can We Prevent Gun Violence in American Schools?
52 minutes ago 4 Replies 1 Medal
Twaylor: possible?
2 days ago 5 Replies 0 Medals
Arriyanalol: hekp
4 days ago 33 Replies 0 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!