def singleRateCalculator(m, t, r): # r : 연 이자
totalMoney = 0
totalRateMoney = 0
for i in range(t):
totalRateMoney += m * (r * 0.01)
totalMoney = m * totalRateMoney
return int(totalMoney)
def multiRateCalculator(m, t, r):
t = t * 12
rateForMonth = (r / 12) * 0.01
totalMoney = m
for i in range(t):
totalMoney *= totalMoney * rateForMonth
return int(totalMoney)
Arithmetic
# basic_operator
def add(n1, n2):
return round(n1 + n2, 2)
def sub(n1, n2):
return round(n1 - n2, 2)
def mul(n1, n2):
return round(n1 * n2, 2)
def div(n1, n2):
return round(n1 / n2, 2)
# developer_operator
def mod(n1, n2):
return round(n1 % n2, 2)
def flo(n1, n2):
return round(n1 // n2, 2)
def exp(n1, n2):
return round(n1 ** n2, 2)
Shape
# triangle_square_area
def calTriangleArea(width, height):
return round(width * height / 2, 2)
def calSquareArea(width, height):
return round(width * height, 2)
# circle_area
def calCircleArea(r):
pi = 3.14
return round(r ** 2 * pi, 2)
from arithmetic import basic_operator as bo
from arithmetic import developer_operator as do
from shape import triangle_square_area as tsa
from shape import circle_area as ca
inputNumber1 = float(input('숫자 1 입력: '))
inputNumber2 = float(input('숫자 2 입력: '))