My output is currently: "2 4 8 16"
I need to start at 1, so it reads "1 2 4 8 16." When i change my range or accumulator, i just get the number of 0's that i wanted to count up.
How can i make it so i can start with 1 and still count up?
Think of 2^? generates 1. i.e. don't start with i = 1.
when you write the for loop have it start at 0 so when you do 2 to the power of 'i' or any varibale you used in the for loop, it starts at 1.
You can try range(number + 1). You have to start from 0 because 2^0 is 1. So no matter what number you enter, the first number returned is always 1
You will want to set your initial variable to 0 because anything to the power of 0 is 1. Then you will want to accumulate that variable by 1 so each time through the loop the number is raised to the next power.