0
Good afternoon, I’m starting programming and I’m having a question about calling function through loop. I created the function and I’m trying to put so that at the end, ask if you want to continue, if I press 0, the loop stops however, pressing qlq another number, it stays in loop without giving result.
def somaimposto(taxaimposto, custo):
return (1 + taxaimposto/100)*custo
taxaimposto = 10
custo = float(input('Qual o custo do produto: '))
print('O valor a ser vendido é de', somaimposto(taxaimposto, custo))
res = 1
while res:
if(res):
somaimposto(taxaimposto, custo)
res = int(input("Digite 0 se desejar encerrar ou qualquer outro numero para continuar: "))
Within your
while
has notprint
so it’s not working– Icaro Martins