Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from __future__ import print_function
- my_matrix = [[0, 0, 0, 0],
- [0, 0, 0, 0],
- [0, 0, 0, 0], ] # to create 4x4 matrix
- def print_matrix(matrix):
- for row in matrix:
- for col in row:
- # end=' ' to avoid the print command create new line on every line
- print(col, end=' ')
- print() # for new line
- def enter_princess_position():
- x, y = map(int, input('Princess position:').split(';'))
- my_matrix[x][y] = 'P'
- print_matrix(my_matrix)
- enter_princess_position()
Advertisement
Add Comment
Please, Sign In to add comment