What will be the output of the following Python code?
print('abcd'.partition('cd'))
(‘ab’, ‘cd’, ”)
(‘ab’, ‘cd’)
error
none of the mentioned
What will be the output of the following Python code snippet?
print('cd'.partition('cd'))
(‘cd’)
(”)
(‘cd’, ”, ”)
(”, ‘cd’, ”)
print('abef'.partition('cd'))
(‘abef’)
(‘abef’, ‘cd’, ”)
(‘abef’, ”, ”)
print('abcdef12'.replace('cd', '12'))
ab12ef12
abcdef12
ab12efcd
print('abef'.replace('cd', '12'))
abef
12
print('abcefd'.replace('cd', '12'))
ab1ef2
abcefd
ab1efd
ab12ed2
print('xyyxyyxyxyxxy'.replace('xy', '12', 100))
xyyxyyxyxyxxy
12y12y1212x12
print('abcdefcdghcd'.split('cd'))
[‘ab’, ‘ef’, ‘gh’]
[‘ab’, ‘ef’, ‘gh’, ”]
(‘ab’, ‘ef’, ‘gh’)
(‘ab’, ‘ef’, ‘gh’, ”)
print('abcdefcdghcd'.split('cd', 0))
[‘abcdefcdghcd’]
‘abcdefcdghcd’
print('abcdefcdghcd'.split('cd', -1))
print('abcdefcdghcd'.split('cd', 2))
[‘ab’, ‘ef’, ‘ghcd’]
[‘ab’, ‘efcdghcd’]
[‘abcdef’, ‘ghcd’]
print('ab\ncd\nef'.splitlines())
[‘ab’, ‘cd’, ‘ef’]
[‘ab ’, ‘cd ’, ‘ef ’]
[‘ab ’, ‘cd ’, ‘ef’]
[‘ab’, ‘cd’, ‘ef ’]
print('Ab!2'.swapcase())
AB!@
ab12
aB!2
aB1@
print('ab cd ef'.title())
Ab cd ef
Ab cd eF
Ab Cd Ef
None of the mentioned
print('ab cd-ef'.title())
Ab cd-ef
Ab Cd-ef
Ab Cd-Ef
print('abcd'.translate('a'.maketrans('abc', 'bcd')))
bcde
abcd
bcdd
print('abcd'.translate({'a': '1', 'b': '2', 'c': '3', 'd': '4'}))
1234
000ab
00ab0
0ab00
ab000
00+99
00099
+0099
+++99
list1 = list()
list1 = []
list1 = list([1, 2, 3])
all of the mentioned