Show coordinate position

Asked 2 years ago, Updated 2 years ago, 16 views

0000000000
0000000000
0000000000
0000000000
0000b00000
0000000000
0000000000
0000000000
0000000000
0000000000

If you say xy coordinates like this (5,5), how do you make the position change like that? (actually 10x10)

python

2022-09-20 16:32

1 Answers

This is how you do it.

arr = [[0 for col in range(11)] for row in range(10)]
#for i in arr:
#    #    for j in i:
#        #        print(j, end=' ')
#    #    print()
#print("Enter x, y.")
x, y = map(int, input().split())
arr[x][y] = "b"
for i in arr:
    for j in i:
        print(j, end=' ')
    print()


2022-09-20 16:32

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.