adplus-dvertising
frame-decoration

Question

What is the output of the two codes shown below?
'{0}'.format(4.56)
'{0}'.format([4.56,])

a.

‘4.56’, ‘4.56,’

b.

‘4.56’, ‘[4.56]’

c.

4.56, [4.56,]

d.

4.56, [4.56,]

Posted under Python

Answer: (b).‘4.56’, ‘[4.56]’

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of the two codes shown below?