Sichanov

balls

Sep 22nd, 2021
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.03 KB | None | 0 0
  1. ball_count = int(input())
  2. total_points = 0
  3. count_red = 0
  4. count_orange = 0
  5. count_yellow = 0
  6. count_white = 0
  7. count_black = 0
  8. count_piked = 0
  9. ball = 0
  10. for i in range(0, ball_count):
  11.     color_count = input()
  12.     if color_count == 'red':
  13.         total_points += 5
  14.         count_red += 1
  15.     elif color_count == 'orange':
  16.         total_points += 10
  17.         count_orange += 1
  18.     elif color_count == 'yellow':
  19.         total_points += 15
  20.         count_yellow += 1
  21.     elif color_count == 'white':
  22.         total_points += 20
  23.         count_white += 1
  24.     elif color_count == 'black':
  25.         ball = 'black'
  26.         count_black += 1
  27.         total_points /= 2
  28.     else:
  29.         count_piked += 1
  30.  
  31. print(f'Total points: {int(total_points)}')
  32. print(f'Points from red balls: {count_red}')
  33. print(f'Points from orange balls: {count_orange}')
  34. print(f'Points from yellow balls: {count_yellow}')
  35. print(f'Points from white balls: {count_white}')
  36. print(f'Other colors picked: {count_piked}')
  37. print(f'Divides from black balls: {count_black}')
  38.  
Advertisement
Add Comment
Please, Sign In to add comment