Created
February 17, 2023 18:10
-
-
Save mirwox/af096615e1ba936ecd9efcae0895f884 to your computer and use it in GitHub Desktop.
Gabarito da questão imposto de importação - DevLife 2023 Quiz 2 - 17/2/23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imposto | |
valor_bem = float(input("Digite o valor do produto aquirido\n")) | |
declarou = input("Voce declarou o bem?") | |
declarou_bool = False # declarando a variável para caso não entre no if sempre existir um valor | |
if declarou == "S": | |
declarou_bool = True | |
elif declarou == "N": | |
declarou_bool = False | |
total = imposto.faz_declaracao(valor_bem, declarou_bool) | |
print(f"Valor total do bem: US$ {total:.2f}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def faz_declaracao(valor_bem, declarou): | |
excedente = valor_bem - 1000 | |
if valor_bem <=1000.00: | |
aliquota = 0 | |
elif declarou: | |
aliquota = 50 | |
else: | |
aliquota = 100 | |
return valor_bem + calcula_imposto(excedente, aliquota) | |
def calcula_imposto(excedente_1000, aliquota): | |
return (excedente_1000)*aliquota/100.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment