input: Write a function to print the Fibonacci series up to a given number of terms. If the input number is less than or equal to 0, the function should print "Invalid input". If the input is 1, it should print the first term only.
  def printFibonacciSeries(n):
      if n <= 0:
          print("Invalid input")
          return
      elif n == 1:
          print("0")
          return
  
      f1 = 0
      f2 = 1
      print(f1, f2, end=" ")
  
      for i in range(2, n):
          next = f1 + f2
          print(next, end=" ")
          f1 = f2
          f2 = next
  
  assert printFibonacciSeries(5)
  assert printFibonacciSeries(1)
  assert printFibonacciSeries(0)
  assert printFibonacciSeries(10)
output: def printFibonacciSeries(n):
      if n <= 0:
          print("Invalid input")
          return
      elif n == 1:
          print("0")
          return
  
      f1 = 0
      f2 = 1
      print(f1, f2, end=" ")
  
      for i in range(2, n):
          next = f1 + f2
          print(next, end=" ")
          f1 = f2
          f2 = next