Question
What is the output of the code shown?x=3.3456789'%f | %e | %g' %(x, x, x)
Answer: Option D
Was this answer helpful ?
The %f %e and %g format specifiers represent floating point numbers in different ways. %e and %E are the same, except that the exponent is in lowercase. %g chooses the format by number content. Hence the output of this code is: '3.345679 | 3.345679e+00 | 3.34568'.
Was this answer helpful ?
Submit Solution