I am trying to understand use of :
. I have below example code. I am not getting what the last line is doing. Please explain. Also please share how or when to use :
listoflists = []
list = []
for i in range(0,10):
list.append(i)
if len(list)>3:
list.remove(list[0])
listoflists.append((list, list[0]))
print (listoflists)
print (listoflists[:][0][1])#print y values only for the first batch, : for all batches
print (listoflists[0][1])
print(listoflists[:])