How can I create variable names programmatically, then assign values to
them?
I've tried creating variables with something like
var('q'+str(n))
but my attempts to assign a value to such a variable have been unsuccessful.
The underlying problem is that I do not know in advance how many variables
will
be required, so I need some way to assign values to indexed variables in
some sort
of loop based on the index. But I can't figure out how to simultaneously
call the variable
using a parameter, and assign a value to this parametrized variable.
This may be a Python issue, rather than Sage...
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.