Answer:def Get_Winnings(m, s):
if not isinstance(m, str) or not isinstance(s, int):
return "Invalid"
try:
num_medals = int(m)
if num_medals < 1 or num_medals > 5:
return "Invalid"
prize_money = num_medals * 75000 + s
return prize_money
except ValueError:
return "Invalid"
def Calculate_Average(total_prize_money, num_medals):
return round(total_prize_money / num_medals, 10)
num_medals = input("Enter Gold Medals Won: ")
sponsored_amt = int(input("How many dollars were you sponsored in total?: "))
prize_money = Get_Winnings(num_medals, sponsored_amt)
if prize_money == "Invalid":
print("Your input is invalid.")
else:
print("Your prize money is: $" + str(prize_money))
avg_prize_money = Calculate_Average(prize_money, int(num_medals))
print("Your average award money per gold medal was " + str(avg_prize_money))
I'm extremely late but here it is!
Explanation:
I cant explain this