How hard can this be?

Alexandre Fayolle alf at
Mon May 21 17:28:52 CEST 2001

On Mon, 21 May 2001 16:12:44 +0100, Patrick Kirk <pknews at> wrote:
>  if x > 0:
>    print "x is positive"
>You would think anyone could enter that but I can't.  I get the following:
>>>> import math
>>>> if x > 0:
>...  print "x is positive"
>Traceback (innermost last):
>  File "<stdin>", line 1, in ?
>NameError: x

You have not defined x. Try assigning a value tu x (e.g. x=1) before running 
the code and things should be nicer.

Alexandre Fayolle
Narval is the first software agent available as free software (GPL).
LOGILAB, Paris (France).

More information about the Python-list mailing list