Ask Your Question
2

Getting symbolic variable without resetting python variable.

asked 2016-04-01 16:11:17 -0500

rlg23 gravatar image

When calling

 var('x')

the variable x gets set to the symbolic expression x just as if we had called

x = var('x')

In particular, any value stored in x is deleted. Is there a way to get a symbolic variable without setting the python variable to be that symbolic variable? I'm not super familiar with how sage handles symbolic variables so this might be unreasonable.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-04-01 17:52:40 -0500

updated 2016-04-01 17:53:10 -0500

Yes there is

sage: t = 19
sage: my_variable = SR.var('t')
sage: t
19
sage: my_variable
t

The behavior of var is very strange and controversial.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-04-01 16:11:17 -0500

Seen: 60 times

Last updated: Apr 01 '16