First time here? Check out the FAQ!

Ask Your Question
2

Getting symbolic variable without resetting python variable.

asked 9 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
2

answered 9 years ago

vdelecroix gravatar image

updated 9 years ago

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.

Preview: (hide)
link

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: 9 years ago

Seen: 344 times

Last updated: Apr 02 '16