1list1 = [48, 39, 23, 15, 11, 12, 5, 9, 7, 3, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0]
2
3def pop_zeros(items):
4 while items[-1] == 0:
5 items.pop()
6
7pop_zeros(list1)
8pop_zeros(list2)
9print(list1)
10
11# Output:
12[48, 39, 23, 15, 11, 12, 5, 9, 7, 3, 0, 0, 1, 0, 1]