On Saturday, December 1, 2018 at 3:36:55 PM UTC-8, Tevian Dray wrote:
>
> How can I create variable names programmatically, then assign values to
> them?
>
> Python doesn't make that particularly easy, and it also doesn't make
accessing variables thus created particularly easy. I suspect the
appropriate solution for you is to construct some container object and
store the values in there, such as:
D={}
for i in [1..20]:
D[3*i+1] = "value"
for i in [1..20]:
print(D[3*i+1])
--
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.