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(‘abef’.partition(‘cd’))

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

Answer: c
Explanation: The separator is not present in the string hence the second and the third elements of the tuple are null strings.

Join The Discussion