[Tutor] def problem
Ron
rha207@worldnet.att.net
Mon, 11 Jun 2001 14:55:58 -0400
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C0F286.9F729540
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm having problems with "def". Here's what I put in and save as =
"test122"
def here():
print "hello"
print
print "that was a space"
This is what I get.
>>> import test123
>>> here()
Traceback (most recent call last):
File "<pyshell#1>", line 1, in ?
here()
NameError: name 'here' is not defined
>>>=20
------=_NextPart_000_0005_01C0F286.9F729540
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2919.6307" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I'm having problems with "def". Here's =
what I put=20
in and save as "test122"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>def here():<BR> print =
"hello"<BR> print<BR> print "that =
was a=20
space"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>This is what I get.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>>>> import =
test123<BR>>>>=20
here()<BR>Traceback (most recent call last):<BR> File =
"<pyshell#1>",=20
line 1, in ?<BR> here()<BR>NameError: name 'here' is =
not=20
defined<BR>>>> </FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01C0F286.9F729540--