Created
August 16, 2022 08:43
-
-
Save mishrasunny174/0dd882bb56d8a0d98094da9e83c7dd9d to your computer and use it in GitHub Desktop.
SIP contribution calculation script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def main(): | |
sip = 5000 | |
years = 5 | |
num_of_months = 12*years | |
total_corpus = 0 | |
average_annual_return = 6.0 | |
for month in range(num_of_months): | |
if month % 6 == 0 and month != 0: | |
sip *= 1.1 | |
total_corpus += sip | |
print(f'Month: {month} : {sip:.2f}, {total_corpus:.2f}') | |
expected_return = years * total_corpus * average_annual_return / 100 | |
print(f'Total Investment: {total_corpus:.2f}, Expected Return: {expected_return:.2f}, Total: {(total_corpus + expected_return): .2f}') | |
if __name__ == "__main__": | |
main() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment