Utilitário para cálculos
Publicado por Leonardo Berbert Gomes 06/01/2005
[ Hits: 5.186 ]
Homepage: https://www.linkedin.com/in/leoberbert
Script simples feito em inputs que calcula impostos pagos, salário, e saldo atual mês a mês.
#!/usr/bin/python import sys print "Time to calculate some interest... ok." print "What is the APR (as a percentage)? ", apr = float(sys.stdin.readline()) / 100.0 mpr = apr / 12 print "\nWhat is your monthly payment? ", payment = float(sys.stdin.readline()) print "\nWhat is your beginning balance? ", balance = float(sys.stdin.readline()) print "-" * 50 print "SCHEDULE..." print "-" * 50 i = 1 begin_balance = balance end_balance = balance total_interest = 0.0 total_paid = 0.0 while end_balance > 0.0: print "MONTH", `i` interest = mpr * begin_balance # Don't overpay. if payment <= begin_balance + interest: real_payment = payment else: real_payment = begin_balance + interest end_balance = begin_balance + interest - real_payment print "\tending balance:" print "\t %f + %f - %f = %f" % \ (begin_balance, interest, real_payment, end_balance) ## set up next month. i = i + 1 begin_balance = end_balance ## count totals. total_paid = total_paid + real_payment total_interest = total_interest + interest print "TOTAL PAID: %f\tTOTAL INTEREST PAID: %f" % (total_paid, total_interest)
Invariância Discreta de Escala
Plano de fundo rotatório no Gnome
Nenhum comentário foi encontrado.
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
IA Turbina o Desktop Linux enquanto distros renovam forças
Como extrair chaves TOTP 2FA a partir de QRCODE (Google Authenticator)
Como realizar um ataque de força bruta para desobrir senhas?
Como usar Gpaste no ambiente Cinnamon
Atualizando o Fedora 42 para 43
Pergunta: Meu teclado não está respondendo direito como e consertar? (0)
SQLITE não quer funcionar no LINUX LMDE6 64 com Lazaruz 4.2 64bit (n... (0)
Secure boot, artigo interessante, nada técnico. (5)









