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?
s=’%s, %s & %s’
s%(‘mumbai’, ‘kolkata’, ‘delhi’)

What will be the output of the following Python code?
s=’%s, %s & %s’
s%(‘mumbai’, ‘kolkata’, ‘delhi’)
a) mumbai kolkata & delhi
b) Error
c) No output
d) ‘mumbai, kolkata & delhi’

Answer: d
Explanation: In the code shown above, the format specifier %s is replaced by the designated substitution. Hence the output of the code shown above is: ‘mumbai, kolkata & delhi’.

Join The Discussion