Probably simple syntax error

Mark Peters mpeters42 at gmail.com
Mon Jul 2 01:07:23 EDT 2007


>         **weights_array(randomizing_counter) = small_randomized_int
>
> The starred line is the one getting the error message: "SyntaxError:
> can't assign to function call"
>
> Now, I do understand what this means. I'm trying to assign to a
> function instead of the value that the function should create. But
> since when is weights_array or small_randomizing_int a function? Both
> are being declared in the code on their first usage. This one has got
> me stumped, maybe you guys can help me out with it?

Using parens () indicates a function call.

I suspect things will work much better using square brackets [].

Square brackets indicate the index into a sequence (like a list)




More information about the Python-list mailing list