-5
Could someone point out to me the error of this code:
valor_hora = float(input('Valor da hora trabalhada: '))
qtd_horas_trabalhadas = int(input('Quantidade de horas trabalahadas: '))
salario_bruto = valor_hora * qtd_horas_trabalhadas
ir = salario_bruto * 0.11
inss = salario_bruto * 0.08
sindicato = salario_bruto * 0.05
salario_liquido = salario_bruto - (ir + inss + sindicato)
print(f'''+ Salário Bruto : R$ {salario_bruto:.2f}
- IR (11%) : R$ {ir:2.f}
- INSS (8%) : R$ {inss:2.f}
- SINDICATO (5%) : R$ {sindicato:.2f}
----------------------------
= Salário líquido : R${salario_liquido:.2f}''')
Traceback (Most recent call last): print(f'''+ Gross Salary : R$ {salario_bruto} Valueerror: Format specifier Missing Precision
That’s right... lack of attention.
– Fabricio Paiva
@Fabriciopaiva the hint I leave with this, is that in these cases always test one by one, if notice similar errors, in isolated tests, does not need to be in the main script, creates an empty script and tests part by part, isolating things is a good way to understand the problem ;)
– Guilherme Nascimento