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 snippet?
print(‘cd’.partition(‘cd’))

What will be the output of the following Python code snippet?
print(‘cd’.partition(‘cd’))
a) (‘cd’)
b) (”)
c) (‘cd’, ”, ”)
d) (”, ‘cd’, ”)

Answer: d
Explanation: The entire string has been passed as the separator hence the first and the last item of the tuple returned are null strings.

Join The Discussion