> "x is %d" % y is standard Python for having variables in strings.

Thank, that helped a lot. In Python documentation I found the
solution.

> > html('In Scientific Notation: ${%d} \cdot 10^{%d}$'%base%exponent)
>
> > doesn't work either.
>
> I didn't see that inhttp://phil4.com/public/Sci.sws.  I'm not sure
> where you saw that.

In fact it is not from that worksheet. I tried to change it. See
below.

> The *ONLY* problem is that it will not automatically run
> thanks to %auto.

I have the solution to that problem though it is not as much of a
solution as rather an idea what the reason could be.
On my system the %auto command works fine if there is no comment in
front of the cell.
Please open a new worksheet and copy the following code into the first
cell.

%auto
%hide
@interact
def _(base=(1..10),exponent=(-6..6)):
    html('The Number: $%f$'%(base * 10**exponent))
    html('In Scientific Notation: ${%d} \cdot 10^{%d}$'%(base,
exponent))

Works with me, and you will see my enhancement to the code. The two
variable thing.

Best regards
R.

-- 
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

Reply via email to