-1
The question is, is there any way to make this program determining the percentage that each one will win according to how much you bet? and also how to know who was the biggest gambler, the middle and the smallest without pre-determining it.
Exercise:
Three friends played the lottery. If they win, the prize should be apportioned in proportion to the value each has given for the realization of the bet.Make a program that reads how much each bettor invested, the value of the prize, and print how much each would win from the prize based in the amount invested.
print('***O PROGRAMA IRÁ LER O VALOR DO PRÊMIO DE LOTERIA E O VALOR INVESTIDO PELOS 3 APOSTADORES***\n')
print('Digite o valor da aposta do maior apostador para o menor.\n')
p = float(input('Qual o valor do prêmio?'))
a = float(input('Quanto investiu o apostador A(maior aposta)?'))
b = float(input('Quanto investiu o apostador B?(aposta do meio)'))
c = float(input('Quanto investiu o apostador C?(menor aposta)'))
res_a = 0.5 * p
res_b = 0.35 * p
res_c = 0.15 * p
print(f'Proporcionalmente alinhado com o valor apostado o apostador A ganhou R${int(res_a)} reais.')
print(f'Proporcionalmente alinhado com o valor apostado o apostador B ganhou R${int(res_b)} reais.')
print(f'Proporcionalmente alinhado com o valor apostado o apostador C ganhou R${int(res_c)} reais.')
Yes, you can read these values using the same function
input
who has already used.– Woss