the difference is, that var(..) itself already injects a variable with that
name into the global namespace, where the other one is an assignment.
i.e.
z = var('y')
gives you a variable y (named "y") and a variable z with the name "y"
sage: z = var('y')
sage: z
y
sage: y
y
you can also create invalid variable names, i.e. the ones starting with a
number:
sage: var('2x')
2x
sage: 2x
------------------------------------------------------------
File "<ipython console>", line 1
2x
^
SyntaxError: invalid syntax
sage: globals()['2x']
2x
sage: type(globals()['2x'])
<type 'sage.symbolic.expression.Expression'>
H
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org