Methinks I'm missing something obvious, but can't quite put my finger on
it. If, in the interpreter, I enter the following code:
def hungry(batVolt):
if batVolt >94:
return ("I am not hungry at the moment")
elif 64 < batVolt < 95:
return ("I'm starting to get hungry")
else:
return ("I'm hungry!")
and then run
hungry(98)
with 98 just being an example of the many numbers I tried when testing
this, I get the return I expected and all is well.
If, however, I save the above in a file named hungry.py, then import
hungry, I get an error, as follows:
import hungry
hungry(96)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'module' object is not callable
So what am I missing? Someone do please point out the obvious. ;-)
regards, Richard
--
sic gorgiamus allos subjectatos nunc
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor