Advertisement
George_Ivanov05

Untitled

Dec 12th, 2022
459
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. nes (32 sloc)  1.12 KB
  2.  
  3. def read_matrix():
  4.     rows, cols = 6, 6
  5.     matrx = []
  6.     for _ in range(rows):
  7.         matrx.append(list(input().split()))
  8.  
  9.     return matrx
  10.  
  11.  
  12. def is_index_valid(r, c, ):
  13.     if 0 <= r < 6 and 0 <= c < 6:
  14.         return True
  15.     return False
  16.  
  17. matrix = read_matrix()
  18. n = 6
  19. m = 6
  20.  
  21. TOTAL_POINTS = 0
  22.  
  23.  
  24. hit_buckets = []
  25.  
  26. for i in range(3):
  27.     row, col = eval(input())
  28.     if is_index_valid(row, col):
  29.         if matrix[row][col] == "B":
  30.             if row not in hit_buckets and col not in hit_buckets:
  31.                 hit_buckets.append([row, col])
  32.                 for j in range(m):
  33.                     if matrix[j][col] != "B":
  34.                         TOTAL_POINTS += int(matrix[j][col])
  35.  
  36. if 100 <= TOTAL_POINTS < 200:
  37.     print(f"Good job! You scored {TOTAL_POINTS} points, and you've won Football.")
  38. elif TOTAL_POINTS < 100:
  39.     print(f"Sorry! You need {100 - TOTAL_POINTS} points more to win a prize.")
  40. if 200 <= TOTAL_POINTS < 300:
  41.     print(f"Good job! You scored {TOTAL_POINTS} points, and you've won Teddy Bear.")
  42. if TOTAL_POINTS >= 300:
  43.     print(f"Good job! You scored {TOTAL_POINTS} points, and you've won Lego Construction Set.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement