Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- board, size = [], 6
- coordinates_of_B = []
- shots_range = 3
- for r in range(size):
- line = input().split(" ")
- line = [int(el) if el.isdigit() else el for el in line]
- board.append(line)
- for c, el in enumerate(line):
- if el == "B":
- coordinates_of_B.append((r, c))
- board[r][c] = 0
- total_points = 0
- for _ in range(shots_range):
- x, y = input().strip("()").split(", ")
- x, y = int(x), int(y)
- if (x, y) in coordinates_of_B:
- column_sum = sum(board[r][y] for r in range(size))
- total_points += column_sum
- if total_points >= 300:
- prize = "Lego Construction Set"
- elif 200 <= total_points < 300:
- prize = "Teddy Bear"
- elif 100 <= total_points < 200:
- prize = "Football"
- else:
- prize = None
- if prize:
- print(f"Good job! You scored {total_points} points, and you've won {prize}.")
- else:
- needed_points = 100 - total_points
- print(f"Sorry! You need {needed_points} points more to win a prize.")
- # print(*board)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement