101k views
2 votes
Adjust the code you wrote for the last problem to allow for sponsored Olympic events. Add an amount of prize money for Olympians who won an event as a sponsored athlete.

The

Get_Winnings(m, s)
function should take two parameters — a string for the number of gold medals and an integer for the sponsored dollar amount. 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.

Here's my answer for question 1 please adjust it thanks!

def Get_Winnings(m):

if m == "1": return 75000

elif m == "2":

return 150000

elif m == "3":

return 225000

elif m == "4":

return 300000

elif m == "5":

return 375000

else:

return "Invalid"

MAIN

medals = input("Enter Gold Medals Won: ")

num = Get_Winnings(medals)

print("Your prize money is: " + str(num))

User Tpol
by
7.0k points

1 Answer

5 votes

Answer:def Get_Winnings(m):

if m == "1": return 75000

elif m == "2":

return 150000

elif m == "3":

return 225000

elif m == "4":

return 300000

elif m == "5":

return 375000

else:

return "Invalid"

MAIN

medals = input("Enter Gold Medals Won: ")

num = Get_Winnings(medals)

print("Your prize money is: " + str(num))

exp: looking through this this anwser seemes without flaws and i dont follow

if you can provide what you are not understanding ican an help