Create a Python function for computing the Fibonacci sequence up to the nth number.
Number n: 10
def fibonacci(n):
    a, b = 0, 1
    for _ in range(n):
        a, b = b, a + b
    return a

print(fibonacci(10)) # outputs 55