# Help getting for loop to double output each time

Hello,
I am writing a program the program is almost complete and performs almost exactly how it is supposed to. The problem I am having is I can’t get the output of the dollar amount to double each time the program runs the for loop.

Here is the program:

``````Money = .01

Days = int(input("Please enter number of days worked. "))

print("----------------------")

for number in range(1, Days +1):

``````

When the program runs, it produces a list like so:

1 --------- .01
2 --------- .02
3 --------- .03
4 --------- .04

What I’m trying to get the output to be is:

1 --------- .01
2 --------- .02
3 --------- .04
4 --------- .08

I managed to figure a way out here is the new code:

``````Money = .01

Days = int(input("Please enter number of days worked. "))

print("----------------------")

for number in range(1, Days +1):
if number == 1:
print(number, "\t", .01)
elif number in range(2, Days +1):
``````

Not sure how great my coding is but this code is preforming the way i needed it too.

A couple of alternative ways of doing it are:

1. Doubling the amount after printing.

or:

1. Doubling the amount before printing but halving it before the loop.

Just for fun of being Monty (evil twin of Python):

``````>>> start = 0.01
>>> for i, value in enumerate((start, *(s for s in [start] for x in range(4) for s in [2 * s])), start=1):
...     print(f'{i}----{value}')
...
1----0.01
2----0.02
3----0.04
4----0.08
5----0.16
``````
1 Like