How many elements will the list1 list contain after execution of the following snippet?
A. two
B. zero
C. one
D. three
How many elements will the list1 list contain after execution of the following snippet?
A. two
B. zero
C. one
D. three
#How many elements will the list1 list contain after execution of the following snippet?
List1 = “don’t think twice, do it!”.split(‘,’)
#Explanation:
#example1
List1 = “don’t think twice, do it!”.split(‘,’)
print(List1)
#result: [“don’t think twice”, ‘ do it!’]
#example2
List1 = “don’t think twice, do it!”.split(‘*’)
print(List1)
#result: [“don’t think twice, do it!”]
# #example3
List1 = “don’t think twice, do it!”.split(‘t’)
print(List1)
#result: [“don'”, ‘ ‘, ‘hink ‘, ‘wice, do i’, ‘!’]
The correct answer is A
got this result [ ‘dont think twice’, ‘ do it’ ] , so it’s two elements. The correct answer is A.
A. two
A. two
The correct answer is A, two elements.