On Tue, Apr 5, 2016 at 11:24 AM, Aaron Meurer <[email protected]> wrote:
> You can just use symbols(variables) (symbols() works with a list of strings).

Or, for some reason if you want to:

variables = ['x', 'y', 'z']
sympy_variables = []
for v in variables:
     sympy_variables[i] = Symbol(v)


The above can be further written concisely as:
sympy_variables = [Symbol(v) for v in variables]

so, sympy_variables will be a list of SymPy symbols in both cases.


>
> Aaron Meurer
>
> On Mon, Apr 4, 2016 at 9:17 PM, theoracle <[email protected]> wrote:
>> Hello,
>>
>> I have searched through the sympy docs and can't seem to find the answer to
>> this.
>>
>> Can I use lists to declare symbols for sympy.
>>
>> example:
>>
>> variables = ['x', 'y', 'z']
>>
>> for i in range (0,len(variables))
>>      variables[i] = symbols(variables[i])
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" 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/sympy.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/33baa071-7ea8-42e8-bd52-10ee10d28cb7%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" 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/sympy.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6LzY6Q9xf2LozpxsreSqNg1dDk2V5U9zYy7_YjyQpE%3D9A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
http://echorand.me

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CANODV3nBki_HGnd%3DeaGJy7Ufsh5G1SKsYCz0QF5G0C6u%2BjAoZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to