How do you figure out where the accumulator starts?

It will depend on what you are using the accumulator for. When we computed a sum, we started at 0. For factorial, we will start at 1. For other problems, it may be different --- you will need to decide how to use the accumulator, what value to start at, and how to update it.

how do i use it to make a factorial! (that's a pun)

Hah. :)

Can we go over accumulators more / Can you accumulate text?

Yes, we'll keep working with accumulators on Monday.

** How do you ask python to calculate a factorial? / whats a factorial / Since we ended on factorials: is there a factorial function in Python, or how do we create a for loop that adds x to (x-1) to (x-2) etc. until the value of (x-n)=0? **

In math, we calculate x factorial (which is written x!, that is, x followed by an exclamation mark) by doing x * (x − 1)*(x − 2)*...*3 * 2 * 1. Notice that this is the same as 1 * 2 * 3 * ... * (x − 2)*(x − 1)*x. You can see one possible way to write factorial in the file factorial-solution.py (make sure to run update21 first). You can uncomment the print statements to see more output that can help you understand what is happening as you walk through the code one step at a time.

Factorial is a common enough function that it is included in the math library:

>>>import math
>>>math.factorial(5)
120
>>.math.factorial(3)
6

Can a for-loop have an indeterminate number of loops and stop when a user inputs a certain number or phrase?

This sounds more like a while loop, which we'll get to in a few weeks. For right now, you will need to plan how to have the for loop repeat the number of times that you want.

What exactly does the variable and the value that initializes the variable mean?

The variable should have a name that is meaningful for whatever you are accumulating, and it should store the data type of thing that you are accumulating. (Today we saw only number accumulators.) It should be initialized to a value that it can be at the beginning of the accumulation --- so, when we were accumulating a sum, we started at 0, because we want to add in numbers and have the accumulator gather (accumulate) those values. For factorial, we should start our accumulator at 1, since we will then multiply to get the values we want.