ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 10 Feb 2013 02:30:12 -0600variables vs argumentshttp://ask.sagemath.org/question/9789/variables-vs-arguments/I'm a newbie so please excuse me with this silly question. I just move from Mathematica to SAGE.
I cannot tell the difference between arguments and variables in SAGE. What're the differences?
Please help.
Thank you in advance! Fri, 08 Feb 2013 19:26:22 -0600http://ask.sagemath.org/question/9789/variables-vs-arguments/Comment by kcrisman for <p>I'm a newbie so please excuse me with this silly question. I just move from Mathematica to SAGE. </p>
<p>I cannot tell the difference between arguments and variables in SAGE. What're the differences? </p>
<p>Please help. </p>
<p>Thank you in advance! </p>
http://ask.sagemath.org/question/9789/variables-vs-arguments/?comment=18266#post-id-18266The right answer to your question is probably "read a Python tutorial", but I think we want to help more than that. Can you give a specific example of where you are finding things confusing (such as a command that works differently)? That would help us a lot in tailoring the answer.Sat, 09 Feb 2013 01:55:55 -0600http://ask.sagemath.org/question/9789/variables-vs-arguments/?comment=18266#post-id-18266Comment by kcrisman for <p>I'm a newbie so please excuse me with this silly question. I just move from Mathematica to SAGE. </p>
<p>I cannot tell the difference between arguments and variables in SAGE. What're the differences? </p>
<p>Please help. </p>
<p>Thank you in advance! </p>
http://ask.sagemath.org/question/9789/variables-vs-arguments/?comment=18265#post-id-18265You may also find http://sagemath.org/doc/prep/Intro-Tutorial.html and the rest of the tutorials at http://sagemath.org/doc/prep/ helpful.Sat, 09 Feb 2013 01:56:27 -0600http://ask.sagemath.org/question/9789/variables-vs-arguments/?comment=18265#post-id-18265Answer by burcin for <p>I'm a newbie so please excuse me with this silly question. I just move from Mathematica to SAGE. </p>
<p>I cannot tell the difference between arguments and variables in SAGE. What're the differences? </p>
<p>Please help. </p>
<p>Thank you in advance! </p>
http://ask.sagemath.org/question/9789/variables-vs-arguments/?answer=14534#post-id-14534For symbolic expressions, `variables()` and `arguments()` methods return the same result. You can observe this by adding `??` at the end of the function name and taking a look at the code.
sage: var('a,b')
(a, b)
sage: t = a*x^2
sage: t.arguments??
def arguments(self):
...
try:
return self._parent.arguments()
except AttributeError:
return self.variables()
For callable expressions, they differ:
sage: t.arguments()
(x,)
sage: t.variables()
(a, x)
Sun, 10 Feb 2013 02:30:12 -0600http://ask.sagemath.org/question/9789/variables-vs-arguments/?answer=14534#post-id-14534