input: Write a function to generate and display the first n numbers in the Fibonacci sequence. The function should take an integer n as input and print each number in the sequence. If n is 1, it should print only 0. If n is 2, it should print 0 and 1. For n greater than 2, it should print the first n Fibonacci numbers.
  def Fibonacci(n):
      if n==1:
          return [0]
      elif n==2:
          return [0, 1]
      else:
          sequence = [0, 1]
          for i in range(2, n):
              sequence.append(sequence[-1] + sequence[-2])
          return sequence
  
  n = 10
  for num in Fibonacci(n):
      print(num)
  
  assert Fibonacci(1)==[0]
  assert Fibonacci(2)==[0, 1]
  assert Fibonacci(5)==[0, 1, 1, 2, 3]
output: def Fibonacci(n):
      if n == 1:
          print(0)
      elif n == 2:
          print(0)
          print(1)
      else:
          a, b = 0, 1
          print(a)
          print(b)
          for _ in range(2, n):
              a, b = b, a + b
              print(b)