Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matrix = [[]] * 2
- matrix[0].append(2)
- print(matrix)
- ### output: [[2], [2]] ###
- other_matrix = []
- for _ in range(2):
- other_matrix.append([])
- other_matrix[0].append(2)
- print(other_matrix)
- ### output: [[2], [0]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement