Report Bug
Qus :

What will be the output of the following Python code?

print('abcdefcdgh'.partition('cd'))

Qus

निम्नलिखित पायथन कोड का आउटपुट क्या होगा?

print('abcdefcdgh'.partition('cd'))


A. (‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
B. (‘ab’, ‘cd’, ‘efcdgh’)
C. (‘abcdef’, ‘cd’, ‘gh’)
D. error


Solution
B. (‘ab’, ‘cd’, ‘efcdgh’)



Explanation
The string is partitioned at the point where the separator first appears.



Report Bug