Advertisement
ipetkov

4 balls

Feb 22nd, 2023
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.10 KB | None | 0 0
  1. n = int(input())
  2.  
  3. red_p = 0
  4. orange_p = 0
  5. yellow_p = 0
  6. white_p = 0
  7. black_p = 0
  8. other_p = 0
  9. red = 0
  10. orange = 0
  11. yellow = 0
  12. white = 0
  13. black = 0
  14. other = 0
  15. all_points = 0
  16.  
  17. for _ in range(n):
  18.     balls = input()
  19.  
  20.     if balls == "red":
  21.         red += 1
  22.         # red_p += 5
  23.         all_points += 5
  24.     elif balls == "orange":
  25.         orange += 1
  26.         # orange_p += 10
  27.         all_points += 10
  28.     elif balls == "yellow":
  29.         yellow += 1
  30.         # yellow_p += 15
  31.         all_points += 15
  32.     elif balls == "white":
  33.         white += 1
  34.         # white_p += 20
  35.         all_points += 20
  36.     elif balls == "black":
  37.         black += 1
  38.         # black_p += 1
  39.         all_points /= 2
  40.     else:
  41. #        other_p += 1
  42.         other += 1
  43.  
  44. # total = (red_p + orange_p + yellow_p + white_p)
  45. #
  46. # for _ in range(black_p):
  47. #     total //= 2
  48.  
  49.  
  50. print(f"Total points: {int(all_points)}")
  51. print(f"Red balls: {red}")
  52. print(f"Orange balls: {orange}")
  53. print(f"Yellow balls: {yellow}")
  54. print(f"White balls: {white}")
  55. print(f"Other colors picked: {other}")
  56. print(f"Divides from black balls: {black}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement