Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quantity = int(input())
- red = 0
- orange = 0
- blue = 0
- green = 0
- max_count = 0
- max_color = ""
- for i in range(quantity):
- color = input()
- if color == "red":
- red += 1
- elif color == "orange":
- orange += 1
- elif color == "blue":
- blue += 1
- elif color == "green":
- green += 1
- if red > orange and red > blue and red > green:
- max_count = red
- max_color = "red"
- elif orange > blue and orange > green and orange > red:
- max_count = orange
- max_color = "orange"
- elif blue > green and blue > red and blue > orange:
- max_count = blue
- max_color = "blue"
- else:
- max_count = green
- max_color = "green"
- print(f"Red eggs: {red}")
- print(f"Orange eggs: {orange}")
- print(f"Blue eggs: {blue}")
- print(f"Green eggs: {green}")
- print(f"Max eggs: {max_count} -> {max_color}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement