# Python: division error

Heres my method:

```def geometricSum(commonRatio, firstTerm, lastTerm):
return ((firstTerm - lastTerm) * commonRatio) / (1 - commonRatio)
```

Interpreter testing:

```    >>> geometricSum(1.0,1.0,100.0)
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "F:\PortablePython_1.1_py3.0.1\sumOfGeometric.py", line 2, in geometricSum
return ((firstTerm-lastTerm)*commonRatio)/(1-commonRatio)
ZeroDivisionError: float division
```

You're dividing by zero. commonRatio is 1.0 so the denominator is 1-1.0 = 0.