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(‘abcdefcdghcd’.split(‘cd’))

What will be the output of the following Python code snippet?
print(‘abcdefcdghcd’.split(‘cd’))
a) [‘ab’, ‘ef’, ‘gh’]
b) [‘ab’, ‘ef’, ‘gh’, ”]
c) (‘ab’, ‘ef’, ‘gh’)
d) (‘ab’, ‘ef’, ‘gh’, ”)

Answer: b
Explanation: The given string is split and a list of substrings is returned.

Join The Discussion