[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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>def here():<BR>&nbsp;&nbsp;&nbsp; print =

"hello"<BR>&nbsp;&nbsp;&nbsp; print<BR>&nbsp;&nbsp;&nbsp; print "that =
was a=20
space"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>This is what I get.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&gt;&gt;&gt; import =
test123<BR>&gt;&gt;&gt;=20
here()<BR>Traceback (most recent call last):<BR>&nbsp; File =
"&lt;pyshell#1&gt;",=20
line 1, in ?<BR>&nbsp;&nbsp;&nbsp; here()<BR>NameError: name 'here' is =
not=20
defined<BR>&gt;&gt;&gt; </FONT></DIV></BODY></HTML>

------=_NextPart_000_0005_01C0F286.9F729540--