Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 17 Online
OpenStudy (anonymous):

Why does it return that 's' is not defined in the following example: def hanoi (n,s,t,b): assert n>0 if n == 1: print 'move', s, 'to', t else hanoi (n-1, s, b, t) hanoi (n, s, t, b) hanoi (n-1, b, t, s)

OpenStudy (anonymous):

btw I'm using python

OpenStudy (anonymous):

because you didn't define it...read http://docs.python.org/release/1.5.1p1/tut/functions.html (its for older python but you can get image of how to do).

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!