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?
print(“Hello {0} and {1}”.format((‘foo’, ‘bin’)))

What will be the output of the following Python code?
print(“Hello {0} and {1}”.format((‘foo’, ‘bin’)))
a) Hello foo and bin
b) Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
c) Error
d) None of the mentioned

Answer: c
Explanation: IndexError, the tuple index is out of range.

Join The Discussion