new guy

SBrunning at trisystems.co.uk SBrunning at trisystems.co.uk
Tue Nov 18 07:19:23 EST 2003


> From:	nards_collective [SMTP:nards_collective at yahoo.com.au]
> a=eI'm new to Python, in fact I'm new to programming. I'm trying to write
> a simulation program, for a biology class I'm teaching next year. the
> following code is giving me trouble and i can't work out why.
> 
> 	if e>= 1 :
> 		a=e
> 	else :
> 		a=0
> 
> 
> I keep getting a syntax error.
> This piece of code is meant to keep the value of a equal to or grater
> than 0. Any odeas would be appreciated.
 
Is that your whole script? If so, it'll get a syntax error 'cos the whole
thing is indented. Change it to:

if e>= 1 :
    a=e
else :
    a=0

And you'll get a NameError instead...

Cheers,
Simon Brunning,
http://www.brunningonline.net/simon/blog/
--LongSig






-----------------------------------------------------------------------
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorised. If you are not the intended recipient, any disclosure,
copying, distribution, or any action taken or omitted to be taken in
reliance on it, is prohibited and may be unlawful. TriSystems Ltd. cannot
accept liability for statements made which are clearly the senders own.





More information about the Python-list mailing list