Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [[0 for _ in range(3)]for i in range(2)]
- len_a, count = 0, 0
- for lists in a:
- for elenents_in_list in lists:
- len_a += 1
- while count < len_a:
- print("Please enter 3 numbers x, y and number with space and press enter")
- try:
- user_1 = list(map(int, input("user_1 enter x, y and number: ").split()))
- user_2 = list(map(int, input("user_2 enter x, y and number: ").split()))
- if a[user_1[0]][user_1[1]] == 0:
- a[user_1[0]][user_1[1]] = user_1[2]
- count += 1
- print(a)
- else:
- print(f"Try again another coord user1 - x: {user_1[0]} and y:{user_1[1]}, this coord already used")
- if a[user_2[0]][user_2[1]] == 0:
- a[user_2[0]][user_2[1]] = user_2[2]
- count += 1
- print(a)
- else:
- print(f"Try again another coord user2 - x: {user_2[0]} and y:{user_2[1]}, this coord already used")
- except IndexError:
- print("Try another index x: 0-2 and y: 0-2 ")
- continue
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement