input: Write a function to generate and display a Fibonacci sequence of the first n numbers. The function should return the Fibonacci number corresponding to the given position in the sequence and print the sequence up to that position. If n is less than or equal to 0, the function should return 0.
  
  def display_fibonacci_sequence(n):
      if n <= 0:
          return 0
      elif n == 1:
          return 0
      elif n == 2:
          return 1
      else:
          sequence = []
          a, b = 0, 1
          for i in range(n):
              sequence.append(a)
              a, b = b, a + b
          for num in sequence:
              print(num)
          return sequence[-1]
  
  assert display_fibonacci_sequence(5) == 3
  assert display_fibonacci_sequence(10) == 34
  assert display_fibonacci_sequence(0) == 0
  assert display_fibonacci_sequence(1) == 0
  assert display_fibonacci_sequence(2) == 1
output: def display_fibonacci_sequence(n):
      if n <= 0:
          return 0
      elif n == 1:
          print(0)
          return 0
      elif n == 2:
          print(0)
          print(1)
          return 1
      else:
          sequence = [0, 1]
          for i in range(2, n):
              sequence.append(sequence[-1] + sequence[-2])
          for num in sequence:
              print(num)
          return sequence[-1]