Mega Code Archive
Categories
/
Python Tutorial
/
String
The %e, %f, and %g formats display floating-point numbers in different ways, as the following interaction demonstrates
x = 1.23456789 print x print '%e | %f | %g' % (x, x, x)