Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ball_count = int(input())
- total_points = 0
- count_red = 0
- count_orange = 0
- count_yellow = 0
- count_white = 0
- count_black = 0
- count_piked = 0
- ball = 0
- for i in range(0, ball_count):
- color_count = input()
- if color_count == 'red':
- total_points += 5
- count_red += 1
- elif color_count == 'orange':
- total_points += 10
- count_orange += 1
- elif color_count == 'yellow':
- total_points += 15
- count_yellow += 1
- elif color_count == 'white':
- total_points += 20
- count_white += 1
- elif color_count == 'black':
- ball = 'black'
- count_black += 1
- total_points /= 2
- else:
- count_piked += 1
- print(f'Total points: {int(total_points)}')
- print(f'Points from red balls: {count_red}')
- print(f'Points from orange balls: {count_orange}')
- print(f'Points from yellow balls: {count_yellow}')
- print(f'Points from white balls: {count_white}')
- print(f'Other colors picked: {count_piked}')
- print(f'Divides from black balls: {count_black}')
Advertisement
Add Comment
Please, Sign In to add comment