Skip to content

Instantly share code, notes, and snippets.

@mishrasunny174
Created August 16, 2022 08:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mishrasunny174/0dd882bb56d8a0d98094da9e83c7dd9d to your computer and use it in GitHub Desktop.
Save mishrasunny174/0dd882bb56d8a0d98094da9e83c7dd9d to your computer and use it in GitHub Desktop.
SIP contribution calculation script
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