Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make a loop for this #370

Closed
riszkyhermawan opened this issue Oct 17, 2020 · 1 comment
Closed

How to make a loop for this #370

riszkyhermawan opened this issue Oct 17, 2020 · 1 comment

Comments

@riszkyhermawan
Copy link

IMG_20201017_154952.jpg

@Yash999-design
Copy link

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

def month(balance):
minimum_payment = balance*0.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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants