input: Write a function to solve the Towers of Hanoi game using a recursive approach in Python. The function should take the number of disks (n), the source peg (source), the spare peg (spare), and the target peg (target) as arguments. The function should print the moves to solve the puzzle and update the pegs accordingly. The function should handle any number of disks and pegs.
  
  assert hanoi(3, ["A1", "A2", "A3"], [], [])==None
  assert hanoi(2, ["A1", "A2"], [], [])==None
  assert hanoi(1, ["A1"], [], [])==None
  assert hanoi(4, ["A1", "A2", "A3", "A4"], [], [])==None
  assert hanoi(0, [], [], [])==None
output: def hanoi(n, source, spare, target):
      if n == 0:
          return
      hanoi(n-1, source, target, spare)
      target.append(source.pop())
      print(f"Move disk {n} from {source[0][0]} to {target[-1][0]}")
      hanoi(n-1, spare, source, target)