Resolved: Question 7: Where is the i?
I am a little confused about this lines
for i in range (n)
a,b = b, a+a
Where is the 2. i in this? I thought i has to be in the next line used in a for loop to work. Why does it work now without a second line with i?
Because of my understanding, I had quite a struggle to solve the question quickly.
Thanks for the help in advance!
Thank you for reaching out!
In this case,
i serves as a counter which counts the number of iterations we have to perform. Examine the following code:
Here, I've added a
i to illustrate how its value changes.
Hope this helps!