Sichanov

bals

Aug 12th, 2021
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. import math
  2.  
  3. x = int(input())
  4.  
  5. red_balls = 0
  6. orange_balls = 0
  7. yellow_balls = 0
  8. white_balls = 0
  9. black_balls = 0
  10. total_points = 0
  11. other_colors = 0
  12.  
  13. while x > 0:
  14.     ball_color = input()
  15.     if ball_color == "red":
  16.         red_balls += 1
  17.         total_points += 5
  18.     elif ball_color == "orange":
  19.         orange_balls += 1
  20.         total_points += 10
  21.     elif ball_color == "yellow":
  22.         yellow_balls += 1
  23.         total_points += 15
  24.     elif ball_color == "white":
  25.         white_balls += 1
  26.         total_points += 20
  27.     elif ball_color == "black":
  28.         black_balls += 1
  29.         total_points /= 2
  30.     else:
  31.         other_colors += 1
  32.     x -= 1
  33.  
  34.  
  35. print(f"Total points: {math.floor(total_points)}")
  36. print(f"Points from red balls: {red_balls}")
  37. print(f"Points from orange balls: {orange_balls}")
  38. print(f"Points from yellow balls: {yellow_balls}")
  39. print(f"Points from white balls: {white_balls}")
  40. print(f"Other colors picked: {other_colors}")
  41. print(f"Divides from black balls: {black_balls}")
Advertisement
Add Comment
Please, Sign In to add comment