Try this: @interact def _(p=(13,[q for q in prime_range(200) if q%4==1])): k=mod(factorial((p-1)/2),p) html("And we can compute that ${0}^2\equiv{1}$ and ${2}^2\equiv {3}\text{ mod }({4})$".format(k,k^2,-k,(-k)^2,p))
I have seen successful use of this new Python string formatting in Sage code, so I know it works. But the results of this are wacky. Even more fun is trying to use this with $\frac{{0}-1}{2}$, where {0} refers to an argument but {2} refers to 2 in the denominator. Yikes! I've found workarounds for my specific needs, but I think it would be nice for someone knowledgeable about Python strings to determine what part of this needs a ticket. - kcrisman -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org