| 1 | initial version |
When you write R = SR.var('R'), the left-hand V is a Python name pointing to the right-hand SR.var('V'), which is a symbolic expression. Then when you write R = 3, the Python name R points to the integer 3, so there is no relationship anymore between R and SR.var('R'):
sage: R = SR.var('R')
sage: type(R)
<type 'sage.symbolic.expression.Expression'>
sage: R = 3
sage: type(R)
<type 'sage.rings.integer.Integer'>
If you want to substitute R with 3 in I, you should do:
sage: I.substitute({R:3})
1/3*V
| 2 | No.2 Revision |
When you write R = SR.var('R'), the left-hand is a Python name pointing to the right-hand VR, which is a symbolic expression. Then when you write SR.var('V')SR.var('R')R = 3, the Python name R points to the integer 3, so there is no relationship anymore between R and SR.var('R'):
sage: R = SR.var('R')
sage: type(R)
<type 'sage.symbolic.expression.Expression'>
sage: R = 3
sage: type(R)
<type 'sage.rings.integer.Integer'>
If you want to substitute R with 3 in I, you should do:
sage: I.substitute({R:3})
1/3*V
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.