Question: Write a Python program that implements the Towers of Hanoi, using the recursive algorithm discussed in class. Use command-line arguments to pass parameters to the
Write a Python program that implements the Towers of Hanoi, using the recursive algorithm discussed in class.
Use command-line arguments to pass parameters to the program -
spring% python towersOfHanoi.py USAGE: towersOfHanoi.py
spring% python towersOfHanoi.py 4 1 3 Move disk from peg 1 to peg 2 Move disk from peg 1 to peg 3 Move disk from peg 2 to peg 3
Move disk from peg 1 to peg 2 Move disk from peg 3 to peg 1 Move disk from peg 3 to peg 2 Move disk from peg 1 to peg 2 Move disk from peg 1 to peg 3 Move disk from peg 2 to peg 3 Move disk from peg 2 to peg 1 Move disk from peg 3 to peg 1
I have gotten this far with writing the program but keep getting "command not found" when trying to run the program.

hanoitowers.py - Downloads 1 import sys if len (sys.argv) != 4 : print 'USAGE: python hanoitowers.py
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
