[Tutor] I think I'm getting ahead of myself
Steven Gilmore
Steven Gilmore" <srGilmore@sprintmail.com
Thu, 20 Jul 2000 19:31:03 -0400
I am reading "How to Think like a Computer Scientist". I can only get half
of the examples to work. Like the recursive example below:
def countdown(n):
if n == 0:
print "Blastoff!"
else:
print n
countdown(n-1)
I'm saving the script in a sub directory of the python directory. I'm
using Windows. I tried adding the directory to the path with
>>> import sys
>>>sys.path.append("d:\python\pyscript")
then I run the script in IDLE
>>> import test
>>> countdown(3)
Traceback (innermost last):
File "<pyshell#4>", line 1, in ?
countdown(3)
NameError: countdown
what's the deal?
Thanks
Steven Gilmore