""" 2048 Core Algorithm """#zero element transplant end#[2,0,2,0] -->[2,2,0,0]list_merge = [2,0,4,8]def zer_to_end():""" from back to front, if zero element is found, remove and append :return: """for i in range(-1,-len(list_merge)-1,-1):if list_merge[i]==0:del list_merge[i]list_merge.append(0)zer_to_end()print(list_merge)