That works. Thank you. 

On Friday, May 1, 2020 at 4:26:47 PM UTC-6, Nils Bruin wrote:
>
> On Friday, May 1, 2020 at 12:30:10 PM UTC-7, John Atom wrote:
>>
>> If I define a function: 
>>
>> f(x) = x**2
>>
>> and then print it, sage always prints it as `x^2`. 
>>
>> Is it possible to change the default output of the power operator to '**' 
>> ? 
>>
>
> I suspect it will be hard, because these "^" are coming from lots of 
> places, including third party libraries that know how to produce a string 
> representation of their internal representation. I think:
>
> str(f).replace('^','**')
>
> is going to be the most reliable way of accomplishing this.
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/75577d39-3841-40e3-a1e9-3ec58336fd19%40googlegroups.com.

Reply via email to