error explanation

Mac Wood malcolm.wood3 at ntlworld.com
Mon Sep 29 23:45:44 CEST 2003


Could someone please explain this error message:

Traceback (most recent call last):
  File "C:\Python23\time.py", line 1, in -toplevel-
    time.py
NameError: name 'time' is not defined

I tried entering the following example:

time.py
#This programs calculates rate and distance problems
print "Input a rate and a distance"
rate = input("Rate:")
distance = input("Distance:")
print "Time:",distance/rate

which according to the tutor should have run as this:

> python times.py
Input a rate and a distance
Rate:5
Distance:10
Time: 2
Thanks for your help




More information about the Python-list mailing list