Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- gold_count = 0
- silver_count = 0
- bronze_count = 0
- while True:
- event = input("Enter the event or type 'done' to finish: ")
- if event.lower() == 'done':
- break
- name = input("Enter the student's name: ")
- medal = input("Enter the type of medal (Gold, Silver, Bronze): ")
- if medal.lower() == 'gold' or medal.lower() == 'silver' or medal.lower() == 'bronze':
- # Print details immediately
- print("Event: " + event + ", Student: " + name + ", Medal: " + medal.capitalize())
- # Update medal counts
- if medal.lower() == 'gold':
- gold_count += 1
- elif medal.lower() == 'silver':
- silver_count += 1
- elif medal.lower() == 'bronze':
- bronze_count += 1
- else:
- print("Invalid medal type. Please enter Gold, Silver, or Bronze.")
- continue
- # Output the total counts of each type of medal
- print("\nMedal Count:")
- print("Gold: " + str(gold_count))
- print("Silver: " + str(silver_count))
- print("Bronze: " + str(bronze_count))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement