input: Write a function to simulate the solution for the Towers of Hanoi game. The function should recursively move the disks from the source peg to the target peg using a spare peg. The output should print the moves indicating which disk is being moved from which peg to which peg. If there is only one disk, it should directly move the disk from the source peg to the target peg.
  
  assert hanoi(3, [(1, "A"), (2, "A"), (3, "A")], [], [])==None
  assert hanoi(2, [(1, "A"), (2, "A")], [], [])==None
  assert hanoi(1, [(1, "A")], [], [])==None
  assert hanoi(0, [], [], [])==None
  assert hanoi(4, [(1, "A"), (2, "A"), (3, "A"), (4, "A")], [], [])==None
output: def hanoi(n, source, target, spare):
      if n == 1:
          disk, from_peg = source.pop()
          target.append((disk, from_peg))
          print(f"Move disk {disk} from {from_peg} to {target[-1][1]}")
      else:
          hanoi(n-1, source, spare, target)
          disk, from_peg = source.pop()
          target.append((disk, from_peg))
          print(f"Move disk {disk} from {from_peg} to {target[-1][1]}")
          hanoi(n-1, spare, target, source)