Lesson goal: Displaying math

Previous: Speaking text | Home | Next: How programs flow

Math on the web can be pretty ugly. Looking at things like 3/2x^2+5/sin(x) makes us cringe. We'd much rather see $\frac{3}{2}x^2+\frac{5}{\sin(x)}$ instead.

We've developed a function called print_math that will take an "ugly" mathematical expression and make it look nice.

print_math("ugly expression")
Move the mouse over a dotted box for more information.

Now you try. Try programming in some expressions, and make them look nice.

Type your code here:


See your results here: