desislava_topuzakova

Untitled

May 10th, 2021
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. count_of_balls = int(input())
  2. red_ball = 0
  3. orange_ball = 0
  4. yellow_ball = 0
  5. white_ball = 0
  6. black_ball = 0
  7. other = 0
  8. total_points = 0
  9. for count in range(count_of_balls):
  10. color_of_ball = input()
  11. if color_of_ball == 'white':
  12. white_ball += 1
  13. total_points += 20
  14.  
  15. if color_of_ball == 'red':
  16. red_ball += 1
  17. total_points += 5
  18.  
  19. if color_of_ball == 'orange':
  20. orange_ball += 1
  21. total_points += 10
  22.  
  23. if color_of_ball == 'yellow':
  24. yellow_ball += 1
  25. total_points += 15
  26.  
  27. if color_of_ball == 'black':
  28. black_ball += 1
  29. total_points = total_points / 2
  30.  
  31. if color_of_ball != 'white' and color_of_ball != 'red' and color_of_ball != 'orange' and color_of_ball != 'yellow' and color_of_ball != 'black':
  32.  
  33. other += 1
  34. total_points += 0
  35.  
  36.  
  37. print(f'Total points: {int(total_points)}')
  38. print(f'Points from red balls: {red_ball}')
  39. print(f'Points from orange balls: {orange_ball}')
  40. print(f'Points from yellow balls: {yellow_ball}')
  41. print(f'Points from white balls: {white_ball}')
  42. print(f'Other colors picked: {other}')
  43. print(f'Divides from black balls: {black_ball}')
  44.  
Advertisement
Add Comment
Please, Sign In to add comment