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