def remove_first(list_of_lists):
for sublist in list_of_lists:
if len(sublist) > 0:
sublist.pop(0)
return list_of_lists
def remove_odds(list_of_lists):
for sublist in list_of_lists:
for i in range(len(sublist)-1, -1, -1):
if sublist[i] % 2 == 1:
sublist.pop(i)
return list_of_lists
if __name__ == "__main__":
original_list = [["banana", "apple"], [], ["pear"]]
remove_first(original_list)
assert original_list == [["apple"], [], []]
numbers = [[1, 1, 1], [0, 0], []]
remove_odds(numbers)
assert numbers == [[], [0, 0], []]