Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- x = int(input())
- red_balls = 0
- orange_balls = 0
- yellow_balls = 0
- white_balls = 0
- black_balls = 0
- total_points = 0
- other_colors = 0
- while x > 0:
- ball_color = input()
- if ball_color == "red":
- red_balls += 1
- total_points += 5
- elif ball_color == "orange":
- orange_balls += 1
- total_points += 10
- elif ball_color == "yellow":
- yellow_balls += 1
- total_points += 15
- elif ball_color == "white":
- white_balls += 1
- total_points += 20
- elif ball_color == "black":
- black_balls += 1
- total_points /= 2
- else:
- other_colors += 1
- x -= 1
- print(f"Total points: {math.floor(total_points)}")
- print(f"Points from red balls: {red_balls}")
- print(f"Points from orange balls: {orange_balls}")
- print(f"Points from yellow balls: {yellow_balls}")
- print(f"Points from white balls: {white_balls}")
- print(f"Other colors picked: {other_colors}")
- print(f"Divides from black balls: {black_balls}")
Advertisement
Add Comment
Please, Sign In to add comment