Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- matrix = [[1,2],[3,4]]
- new_copies = []
- counter = 0
- for i in range(0,2):
- for k in range(0,2):
- if matrix[i][k] > 3:
- exec("item%s = matrix[:]" % counter)
- exec("item%s[i][k] = matrix[i][k] + 10" % counter)
- exec("new_copies.append(item%s)" % counter)
- counter += 1
- print(matrix)
- print(new_copies)
- new_matrix = original_matrix[:]
Add Comment
Please, Sign In to add comment