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(name1=’foo’, name2=’bin’))

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

Answer: a
Explanation: The arguments are accessed by their names.

Join The Discussion