Create an algorithm in Python to calculate the Fibonacci sequence up to a given number.
Not applicable
def fibonacci(n):
  a, b = 0, 1
  while a < n:
    print(a, end=' ')
    a, b = b, a+b

fibonacci(100)