Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- #
- # imobiliaria.py
- #
- # Copyright 2021 Elizeu Barbosa Abreu <[email protected]>
- #
- # This program is free software; you can redistribute it and/or modify
- # it under the terms of the GNU General Public License as published by
- # the Free Software Foundation; either version 2 of the License, or
- # (at your option) any later version.
- #
- # This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- #
- # You should have received a copy of the GNU General Public License
- # along with this program; if not, write to the Free Software
- # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- # MA 02110-1301, USA.
- #
- #
- # IMPORTAÇÃO DAS BIBLIOTECAS
- from time import sleep
- import os
- def cls():
- os.system('clear')
- class cores:
- VERDE = '\033[92m'
- AMARELO = '\033[93m'
- VERMELHO = '\033[91m'
- FECHAR = '\033[0m'
- def credito():
- cls()
- print('{}{:^45}{}\n'.format(cores.VERMELHO, 'ANÁLISE DE CRÉDITO', cores.FECHAR))
- preco = float(input('ENTRE COM O VALOR DO IMÓVEL: R$'))
- parcelas = float(input('EM QUANTOS ANOS DESEJA QUITAR O IMÓVEL: '))
- parcela = parcelas*12 # Converte ano em meses
- salario = float(input('QUAL É O SEU SALÁRIO MENSAL: R$'))
- # calculo do valor da parcela sem juros
- mensalidade = preco/parcela
- if mensalidade <= 0.3*salario:
- print('{}CRÉDITO APROVADO!!!\na mensalidade fica em R${:.2f}...\nBoa sorte!!!!{}'.format(cores.VERDE, mensalidade, cores.FECHAR))
- else:
- print('{}olá, a mensalidade fica em R${:.2f} maior que 30% de seu salário...\nCRÉDITO NÃO APROVADO!!!\nTente dividir em mais parcelas ou procure outro imóvel!!!{}'.format(cores.VERMELHO, mensalidade, cores.FECHAR))
- sleep(5)
- cls()
- print('{}{:^45}{}'.format(cores.VERMELHO, 'ANÁLISE DE CRÉDITO', cores.FECHAR))
- print('\n{}RENDERIZANDO NOVO CRÉDITO...{}'.format(cores.VERDE, cores.FECHAR))
- sleep(2)
- c = True
- while c:
- credito()
Advertisement
Add Comment
Please, Sign In to add comment