Q:

Is this working properly - Sum of Fibonacci in Python 3

I have a task to make a program that will sum the first 100 Fibonacci numbers. I checked my output in Python, and my output in QBasic 64 and they aren't same. I checked with different inputs also.
Input: 10
Output: 89
-----------
Input: 100
Output: 573147844013817084101

Is it correct ?
Here is my code:
n = int(input())
print()

p = 0
d = 1
z = p + d

print(str(p) + ' + ' + str(d) + ' = ' + str(z))

for i in range(n - 2):

    p = d
    d = z
    z = p + d
    print(str(p) + ' + ' + str(d) + ' = ' + str(z))

print('Sum:', z)

EDIT: Code edited again, check it now. I just found on Wikipedia.. It depends from what number you start the loop. So if I use (0, 1, 1, 2, 3, 5, 8, 13, 21, and 34) as first 10 Fibonacci numbers, the sum is going to be 88, not 89.

A:

The sums of the first ten and 100 fibonacchi number would be 88 and 573147844013817084100, respectively:
>>> cache = {}

>>> def fib(n):
        if n == 0: return 0
        if n == 1: return 1
        if not n in cache:
            cache[n] = fib(n - 1) + fib(n - 2)
        return cache[n]

>>> sum([fib(i) for i in range(10)])
88
>>> sum([fib(i) for i in range(100)])
573147844013817084100

