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 {name1} and {name2}”.format(‘foo’, ‘bin’))

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

Answer: c
Explanation: The arguments passed to the function format aren’t keyword arguments.

Join The Discussion