Examveda

What will be the output of the following Python code?
'{a}, {0}, {abc}'.format(10, a=2.5, abc=[1, 2])

A. Error

B. '2.5, 10, [1, 2]'

C. 2.5, 10, 1, 2

D. '10, 2.5, [1, 2]'

Answer: Option B


This Question Belongs to Python Program >> Formatting And Decorators

Join The Discussion

Related Questions on Formatting and Decorators