What will be the output of the following Python code?
def example(L):
''' (list) -> list
'''
i = 0
result = []
while i < len(L):
result.append(L[i])
i = i + 3
return result
def example(L):
''' (list) -> list
'''
i = 0
result = []
while i < len(L):
result.append(L[i])
i = i + 3
return result
A. Return a list containing every third item from L starting at index 0
B. Return an empty list
C. Return a list containing every third index from L starting at index 0
D. Return a list containing the items from L starting from index 0, omitting every third item
Answer: Option A
Join The Discussion