Show-Me-the-Code / python

Show Me the Code Python version.
https://github.com/Show-Me-the-Code/show-me-the-code
MIT License
3.91k stars 2.74k forks source link

How to make a loop for this #370

Closed riszkyhermawan closed 3 years ago

riszkyhermawan commented 3 years ago

IMG_20201017_154952.jpg

Yash999-design commented 3 years ago

""" I used month as function name instead of month1 """

def month(balance): minimum_payment = balance0.02 unpiad_balance = balance - minimum_payment interest = (0.18/12.0) unpiad_balance next_month_balance = unpiad_balance + interest return next_month_balance

print("Remaining Balance =", next_month_balance)

def result_printer(): total = 0

for i in range(12):
    if total == 0:
        value = int(input())
        total = month(value)
    else:
        output = month(total)
        total = output

print("Remaining Balance = ", total)  

result_printer()