Vidyalelo
Python · Q123

MCQs for Python Strings: Exam

Programming · Python · question 123

Q123

What will be the output of the following Python code snippet? print('abcdefcdghcd'.split('cd', -1))

A.
['ab', 'ef', 'gh']
B.
['ab', 'ef', 'gh', "]
Answer
C.
('ab', 'ef', 'gh')
D.
('ab', 'ef', 'gh', ")

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board