[Tutor] Missing the Obvious Again??

DavidCraig@PIA.CA.GOV DavidCraig@PIA.CA.GOV
Mon, 2 Jul 2001 15:54:33 -0700


In doing the exercises in "How To Think Like A Computer Scientist (Python)"
I am trying the following:

def addTime(t1, t2):
    sum = Time()
    sum.hour = t1.hour + t2.hour
    sum.minute = t1.minute + t2.minute
    sum.second = t1.second + t2.second
    return sum

currentTime = Time()
currentTime.hour = 9
currentTime.minute = 14
currentTime.second = 30

breadTime = Time()
breadTime.hour = 3
breadTime.minute = 35
breadTime.second = 0

doneTime = addTime(currentTime, breadTime)
printTime(doneTime)


Here is the output I get:

Python 2.1 (#15, Apr 16 2001, 18:25:49) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.8 -- press F1 for help
>>>
Traceback (most recent call last):
  File "C:/Python21/Practice/addTime.py", line 24, in ?
    printTime(doneTime)
NameError: name 'printTime' is not defined

Must this be defined outside this file?  I expect to print the result but
continue to get this message.  Thanks in advance for any help.

Dave

D. H. Craig, CSM