Utilitário para cálculos
Publicado por Leonardo Berbert Gomes 06/01/2005
[ Hits: 5.160 ]
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)
Crivo de Eratóstenes Simples em Python
Compressão de série numérica em Python
Script para fazer o Scroll Lock funcionar no Linux
Nenhum comentário foi encontrado.
Desktop Linux em alta: novos apps, distros e privacidade marcam o sábado
IA chega ao desktop e impulsiona produtividade no mundo Linux
Novos apps de produtividade, avanços em IA e distros em ebulição agitam o universo Linux
Desktop Linux ganha novos apps enquanto IA invade o noticiário
Blender 5.0 Beta, Firefox 144 e avanço da IA dominam o dia no mundo Linux
Como mudar o nome de dispositivos Bluetooth via linha de comando
Adicionando o repositório backports no Debian 13 Trixie
Baixar jogos Independentes para Ubuntu [RESOLVIDO] (4)
PIP3 - erro ao instalar módulo do mariadb para o Python (1)
Linux x Plataformas de Trading - um problema (in-)solúvel? (4)