print#
Interpolate values into a string template.
Available in: math cells, REPL.
Syntax#
print(template, values)
print(template, values, precision)
Arguments and behavior#
Substitutes $name placeholders from the scope object — the sigil is a dollar sign, not braces, so print("r=$r", {r:3}) is r=3. The scope argument is required even when the template has no placeholders. The optional third argument sets precision. Unlike the display settings, this builds a string.
Example#
Edit the inputs, then use Run or Reset. Changes stay in this example.
Example
print("radius=$r",{r:3})Interactive examples could not load. You can still copy the expressions.
Expected result: "radius=3".