Q:

Ignore the initial value of the parameter in calculation

I have the following code. The formula is answer = (b*a)+c. I want to display a and the answer 
c = 9
qq = 4
b = 5
a = 0

for i in range(5):
    answer = (b*a)+c
    a += qq

    print a, answer

Once this program runs, it displays its values starting from 
4 9 

up to 
20 89

It runs fine, but I do not want 9 to be displayed beside 4. Instead I want 29 to be displayed beside 4 because that is the answer when 4 is plugged in for a. I've been trying for an hour now, but I do not know how to do that.

A:

Its because your iterating a before you display it.
c = 9
qq = 4
b = 5
a = 0

for i in range(5):
    answer = (b*a)+c
    print a, answer
    a += qq

will display:
0 9
4 29
...
20 109       

