Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+6 votes
asked in CSC201 Spring 2021 by (1 point)
+2

Hey,
Could you please rephrase the question, because i dont understand what you said! because i think what you mean and know the answer but not sure!!
And if the answer is what Furman Doty said then NVM!!!

1 Answer

+4 votes

Do you mean how we set the variable before a for loop? like

y = 0
for i in range(x):
    y = y+1

why we do y = 0?
if so, its because otherwise when the loop tries to run

y = y+1

it wouldn't have a value for the y on the right side, so it couldn't give an answer.
If that wasn't your question, I'm not sure what you mean—please clarify.

answered by (1 point)
+4

Yesss thats what I meant and thanks for clarifying the use of accumulation

...