Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

embeding a variable in some html code in cloud.sagemath

Hello, I try to produce an equation and to display it as follow:

import random
nombres = [-3, 1, -4, -1, 5, 2, 7]
nombre = random.choice(nombres)

%html
<h2> R&eacute;solvons une &eacute;quation </h2>
<font size="+3">
        <div align="center">
            $ x+ b=k $
        </div>
    </font>

<h3> Exemple :  résoudre : $ x+$ <sage>nombre</sage>$=12 $ </h3>

But the last line failed to display the value of nombre in the equation

What is the good way to do that? Thank you