[Tutor] populating an array or using a dictionary

Kent Johnson kent37 at tds.net
Sun Oct 21 22:00:25 CEST 2007


Bryan Fodness wrote:
> it doesn't fix the problem, now it says there is a syntax error on the 
> equal sign.

Please, post your code and the exact error message and traceback! Don't 
make us guess what you are doing!

My guess is you forgot the closing ) but I have no way to know for sure.

Kent
> 
> On 10/21/07, *Alan Gauld* <alan.gauld at btinternet.com 
> <mailto:alan.gauld at btinternet.com>> wrote:
> 
> 
>     "Bryan Fodness" <bryan.fodness at gmail.com
>     <mailto:bryan.fodness at gmail.com>> wrote in
> 
>      >    d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10,
>      >    fs11, fs12, fs13, fs14, fs15, fs16, fs17, fs18, fs19,
>      >    fs20, fs21, fs22, fs23, fs24, fs25, fs26, fs27, fs28,
>      >    fs29, fs30, fs31, fs32, fs33, fs34, fs35, fs36, fs37,
>      >    fs38, fs39, fs40 = line.split()
> 
>     Because your tuple spans multiple lines I think you
>     will need to put parens round it.
> 
>      >>> a,b,c,d
>     Traceback (most recent call last):
>     File "<input>", line 1, in ?
>     NameError: name 'a' is not defined
>      >>> (a,b,c,d
>     ...
> 
>     So starting with a paren tells Python to ignore the newline.
>     Without it it gets confused about what you want to do.
> 
>     HTH,
> 
>     --
>     Alan Gauld
>     Author of the Learn to Program web site
>     http://www.freenetpages.co.uk/hp/alan.gauld
> 
> 
> 
>     _______________________________________________
>     Tutor maillist  -  Tutor at python.org <mailto:Tutor at python.org>
>     http://mail.python.org/mailman/listinfo/tutor
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list