Created
October 28, 2025 23:20
-
-
Save lidymonteiro/44f104152a751c0ce5562e66ad052e87 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| valor = float(input('Valor das compras: ')) | |
| print('FORMAS DE PAGAMENTO') | |
| print('[ 1 ] à vista em dinheiro/pix (10% de desconto)') | |
| print('[ 2 ] à vista no cartão (5% de desconto)') | |
| print('[ 3 ] 2x no cartão (5% de acréscimo)') | |
| print('[ 4 ] 3x até 10x no cartão (10% de acréscimo)') | |
| opcao = int(input('Qual a forma de pagamento? ')) | |
| total = 0 | |
| if opcao == 1: | |
| total = valor - (valor * 0.10) | |
| elif opcao == 2: | |
| total = valor - (valor * 5/100) | |
| elif opcao == 3: | |
| total = valor + (valor * 5/100) | |
| parcelas = total / 2 | |
| print(f'O valor da parcela será 2x de {parcelas} com juros.') | |
| elif opcao == 4: | |
| quantidade = int(input('Quantas parcelas? ')) | |
| if quantidade >= 3 and quantidade <= 10: | |
| total = valor + (valor * 10/100) | |
| parcelas = total / quantidade | |
| print(f'O valor da parcela será {quantidade}x de {parcelas} com juros.') | |
| else: | |
| total = valor | |
| print('Quantidade de parcelas não permitida!') | |
| else: | |
| total = valor | |
| print('Opção inválida de pagamento! Tente novamente.') | |
| print(f'O total da compra será de R$ {total}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment