input: def fibonacci(n: int) -> str:
      """
      Develop an algorithm in Python to print Fibonacci series up to a given number.
      >>> fibonacci(5)
      '0 1 1 2 3'
      >>> fibonacci(10)
      '0 1 1 2 3 5 8'
      """
      a = 0
      b = 1
      if n < 0:
          return "Incorrect input"
      elif n == 0:
          return str(a)
      elif n == 1:
          return str(a) + " " + str(b)
      else:
          result = [a, b]
          for i in range(2, n):
              c = a + b
              result.append(c)
              a = b
              b = c
          return ' '.join(map(str, result))
output:     a = 0
      b = 1
      if n < 0:
          return "Incorrect input"
      elif n == 0:
          return str(a)
      elif n == 1:
          return str(a) + " " + str(b)
      else:
          result = [a, b]
          while True:
              c = a + b
              if c > n:
                  break
              result.append(c)
              a = b
              b = c
          return ' '.join(map(str, result))