Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count_of_balls = int(input())
- red_ball = 0
- orange_ball = 0
- yellow_ball = 0
- white_ball = 0
- black_ball = 0
- other = 0
- total_points = 0
- for count in range(count_of_balls):
- color_of_ball = input()
- if color_of_ball == 'white':
- white_ball += 1
- total_points += 20
- if color_of_ball == 'red':
- red_ball += 1
- total_points += 5
- if color_of_ball == 'orange':
- orange_ball += 1
- total_points += 10
- if color_of_ball == 'yellow':
- yellow_ball += 1
- total_points += 15
- if color_of_ball == 'black':
- black_ball += 1
- total_points = total_points / 2
- 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':
- other += 1
- total_points += 0
- print(f'Total points: {int(total_points)}')
- print(f'Points from red balls: {red_ball}')
- print(f'Points from orange balls: {orange_ball}')
- print(f'Points from yellow balls: {yellow_ball}')
- print(f'Points from white balls: {white_ball}')
- print(f'Other colors picked: {other}')
- print(f'Divides from black balls: {black_ball}')
Advertisement
Add Comment
Please, Sign In to add comment