Vidyalelo
Python · Q37

Formatting and Decorators

Programming · Python · question 37

Q37

What will be the output of the python code shown below for various styles of format specifiers? x=1234 res='integers:...%d...%-6d...%06d' %(x, x, x) res

A.
'integers:…1234…1234 …001234'
Answer
B.
'integers…1234…1234…123400'
C.
'integers:… 1234…1234…001234'
D.
'integers:…1234…1234…001234'

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board