Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to print equations and numbers on a single line:

I am trying to print a string, an equation and a number on the same line using the following form:

 print "Electron Gyrofrequency=", show(fce) , "= %0.5e" % fce.substitute(values)

However the output does not show as a single line. Any help would be appreciated.

How to print equations and numbers on a single line:

I am trying to print a string, an equation and a number on the same line using the following form:

 B=var('B')
 fce=var('fce', latex_name='f_{ce}')
 fce=2.80e6 * B
 values={B:1.0e5}
 print "Electron Gyrofrequency=", show(fce) , "= %0.5e" % fce.substitute(values)

However the output does not show as a single line. Any help would be appreciated.