0
I was writing a program to calculate Paypal fees to help some friends of mine, but in my section against user faults, if the input is not specified, the looping simply ignores the rest of the program and closes. What’s wrong? EDIT: I also notice that Else is ignored
while True:
response = input("Você quer calcular o quanto vai receber, ou o quanto precisa ser pago?\nResponda com recebido ou pago: \n")
if response == 'pago' or 'recebido':
break
else:
print("Algo deu errado. Responda especificamente com 'pago' ou 'recebido")
try:
if response == "recebido":
given = input("Ponha o quanto será pago: ")
given = float(given)
received = float(given * 0.9521) - 0.60
print('O recebido será ',received,'.')
elif response == "pago":
received = input("Ponha o quanto quer receber: ")
received = float(received)
given = float(received + 0.60) / 0.9521
print('Você precisará pagar ',given,'.')
except:
print("Algo deu errado, tente outra vez. Lembre-se de usar pontos '.', e não vírgulas ','")
It wasn’t supposed to keep looping endlessly until it was right?
– Lenon Af