LoginSignup
1
1

More than 3 years have passed since last update.

ローン返済のシミュレーションができるスクリプトを作った

Posted at

1. はじめに

このスクリプトは一定期間で利子がつくローンの返済金額を計算することができます。
具体的には、借入額と返済回数と金利を入力することで、毎回の返済額・金利分・残額を出力することができます。
実際のローン返済の方法にもとづいて、元利均等返済と元金均等返済の両パターンに対応しています。

インストールはこちらから。
https://github.com/shion-0412/Interest-calculation

2. 開発環境

mac OS
ターミナル

3. 用語説明

返済回数
返済を行う回数。返済が毎月ならば月数、毎年ならば年数のように数えてください。
返済期間が10年で毎月返済する場合、返済回数は120です。

金利
残額に対して一定期間で乗算される比率のことです。
単利と複利の2つの方式がありますが、ローンの場合は金利込みの残額に対してさらに金利がかけられる、複利方式です。

元利均等返済
毎回の返済額が、おしなべて同額となる返済方式です。
返済の目処が立てやすいですが、返済総額は増えます。

元金均等返済
毎回の返済額のうち、元金の額が一定となる返済方式です。
初期の返済額が高額になりますが、利子分の返済額が少なく抑えられます。

4. 使い方

元金均等返済
##入力##
python repayment.py gankin
type the principal (yen): [借入額]
type the number of repayment: [返済回数]
type the interest rate (%): [一回あたりの金利]
##出力##
time--repayment--interest--remains
[回数]---[返済額]--[金利分]--[残額]
Total repayment: [返済総額] yen.
 Total interest: [利子総額] yen.
元利均等返済
##入力##
python repayment.py ganri
type the principal (yen): [借入額]
type the number of repayment: [返済回数]
type the interest rate (%): [一回あたりの金利]
##出力##
time--repayment--interest--remains
[回数]---[返済額]--[金利分]--[残額]
Every repayment: [毎回の返済額] yen.
Total repayment: [返済総額] yen.
 Total interest: [利子総額] yen.

5. 注意

ナニワ金融道を読んで思いつきで作りました。
ガチでローンの見積もりがしたい人は銀行に行ってください。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1