91. |
What will be the output of the following Python code snippet?
x=3.3456789
'%-6.2f | %05.2f | %+06.1f' %(x, x, x)
|
||||||||
Answer:
Option (a) |
92. |
What will be the output of the following Python code snippet?
x=3.3456789
'%s' %x, str(x)
|
||||||||
Answer:
Option (b) |
93. |
What will be the output of the following Python code snippet?
'%(qty)d more %(food)s' %{'qty':1, 'food': 'spam'}
|
||||||||
Answer:
Option (d) |
94. |
What will be the output of the following Python code snippet?
a='hello'
q=10
vars()
|
||||||||
Answer:
Option (a) |
95. |
What will be the output of the following Python code?
s='{0}, {1}, and {2}'
s.format('hello', 'good', 'morning')
|
||||||||
Answer:
Option (c) |
96. |
What will be the output of the following Python code?
s='%s, %s & %s'
s%('mumbai', 'kolkata', 'delhi')
|
||||||||
Answer:
Option (d) |
97. |
What will be the output of the following Python code?
t = '%(a)s, %(b)s, %(c)s'
t % dict(a='hello', b='world', c='universe')
|
||||||||
Answer:
Option (a) |
98. |
What will be the output of the following Python code?
'{a}, {0}, {abc}'.format(10, a=2.5, abc=[1, 2])
|
||||||||
Answer:
Option (b) |
99. |
What will be the output of the following Python code?
'{0:.2f}'.format(1.234)
|
||||||||
Answer:
Option (c) |
100. |
What will be the output of the following Python code?
'%x %d' %(255, 255)
|
||||||||
Answer:
Option (a) |