how to I enter pi into a prompt?
What component will you be entering pi into? Certain components like titles and initialText do not accept latex “pi”. In those cases you can just copy/paste a symbol ( π ) there. Though, it won’t be as pretty as the mathy version. Side note: you can actually paste in almost any symbol or emoji into text.
If you’re using a component that supports latex you can use
\\pi. Don’t forget backticks around all mathy text!
Using “\pi\” still gives an error message (see below)
I want to pass this on to use as the slope of a graph.
Fountain Valley School of Colorado
6155 Fountain Valley School Road
Colorado Springs, CO 80911
Phone: (719) 391-5344
Ooh, this looks like you’re using it as a condition and not in a prompt (i.e. not printing it in a note). Seems very similar to the discussion happening in the other thread on the forum: Pi as student input
I wouldn’t recommend checking against an irrational number and the best advice I can give is to use pi to a long decimal (less than 15 places) here. I’d recommend something like 5-8 digits.
slope_graph.number("m") < 3.14159265 or slope.graph.number("m")>3.14159266 "...try again...."
Okay, thank you for the advice Jay!