Skip to content

Instantly share code, notes, and snippets.

@PushkraJ99
Last active June 5, 2022 15:30
Show Gist options
  • Select an option

  • Save PushkraJ99/9a4f36ed73faf5c38e636038d0e87344 to your computer and use it in GitHub Desktop.

Select an option

Save PushkraJ99/9a4f36ed73faf5c38e636038d0e87344 to your computer and use it in GitHub Desktop.
Tower Of Hanoi Python
#Tower Of Hanoi (Github:-PushkraJ99)
from tkinter import N
def TOH(numbers, start, aux, end):
if numbers ==1:
print("Move Disk 1 From Rod {} to Rod {} ".format(start,end))
return
TOH(numbers-1,start,end,aux)
print("Move Disk {} From Rod {} to Rod {} ".format(numbers,start,end))
TOH(numbers-1,aux,start,end)
TOH (disc,"A","B","C")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment