Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What will be the output of the following Python code?
‘{0:f}, {1:2f}, {2:05.2f}’.format(1.23456, 1.23456, 1.23456)

What will be the output of the following Python code?
‘{0:f}, {1:2f}, {2:05.2f}’.format(1.23456, 1.23456, 1.23456)
a) Error
b) ‘1.234560, 1.22345, 1.23’
c) No output
d) ‘1.234560, 1.234560, 01.23’

Answer: d
Explanation: In the code shown above, various formatting options are displayed using the format option. Hence the output of this code is: ‘1.234560, 1.234560, 01.23’

Join The Discussion