Skip to content

Instantly share code, notes, and snippets.

@felipecruz
Created December 19, 2015 15:00
Show Gist options
  • Save felipecruz/59585cce444bd19ca4db to your computer and use it in GitHub Desktop.
Save felipecruz/59585cce444bd19ca4db to your computer and use it in GitHub Desktop.
# errado - identação de "if not imposto"
salario = int(input('Salario? '))
imposto = 27.
while imposto > 0.:
imposto = input('Imposto ou (0) para sair: ')
if not imposto:
imposto = 27.
else:
imposto = float(imposto)
print("Valor real: {0}".format(salario - (salario * (imposto * 0.01))))
# certo
salario = int(input('Salario? '))
imposto = 27.
while imposto > 0.:
imposto = input('Imposto ou (0) para sair: ')
if not imposto:
imposto = 27.
else:
imposto = float(imposto)
print("Valor real: {0}".format(salario - (salario * (imposto * 0.01))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment