input: Write a function to solve the Towers of Hanoi game by moving disks from a source peg to a target peg using a spare peg. The function should print the sequence of moves required to solve the problem. If the input list of disks on the source peg is empty, the function should print a message indicating no moves are needed.
  def hanoi(n, source, spare, target):
      if n == 1:
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
      elif n > 1:
          hanoi(n-1, source, target, spare)
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
          hanoi(n-1, spare, source, target)
      else:
          print("No moves needed.")
  
  assert hanoi(3, [(1, "A"), (2, "A"), (3, "A")], [], [])==None
  assert hanoi(0, [], [], [])==None
  assert hanoi(4, [(1, "A"), (2, "A"), (3, "A"), (4, "A")], [], [])==None
output: def hanoi(n, source, spare, target):
      if n == 1:
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
      elif n > 1:
          hanoi(n-1, source, target, spare)
          disk = source.pop(0)
          print("Moving disk {0} from {1} to {2}".format(disk[0], disk[1], target[1]))
          target.insert(0, disk)
          hanoi(n-1, spare, source, target)
      else:
          print("No moves needed.")