198k views
0 votes
Write a program that awards Olympians for winning gold medals. Let’s say there are five events today, and for every gold medal the winner receives $75,000. Prompt the user for how many gold medals the Olympian won.

The Get_Winnings(m) function should take exactly one parameter—a string for the number of gold medals. It will return either an integer for the money won or a string Invalid, if the amount is invalid. Olympians can win more than one medal per day.

Write a program that awards Olympians for winning gold medals. Let’s say there are-example-1
User Jimmt
by
7.5k points

1 Answer

5 votes

Answer:

Step-by-step explanation:

def Get_Winnings(m):

try:

m = int(m)

if m < 0:

return "Invalid"

else:

return m * 75000

except:

return "Invalid"

medals = input("Enter the number of gold medals won: ")

print("Your prize money is: $" + str(Get_Winnings(medals)))

User Prashant Agarwal
by
6.6k points