Slicing A List Of Lists
matrix = [[0, 0], [0, 0], [0, 0]]
top_two = matrix[:2]
top_two[0][0] = 1
top_two.append([9, 9])
print(matrix)
print(top_two)
What does this print?
Sign in to answer questions and track your progress
Sign Inmatrix = [[0, 0], [0, 0], [0, 0]]
top_two = matrix[:2]
top_two[0][0] = 1
top_two.append([9, 9])
print(matrix)
print(top_two)
What does this print?
Sign in to answer questions and track your progress
Sign In