Skip to content

Instantly share code, notes, and snippets.

@muiton
Created March 8, 2019 09:38
Show Gist options
  • Save muiton/6205514d90e624af584bdc7c1ec0f08c to your computer and use it in GitHub Desktop.
Save muiton/6205514d90e624af584bdc7c1ec0f08c to your computer and use it in GitHub Desktop.
print('Interest Calculator:')
amount = float(input('Principal amount ?'))
roi = float(input('Rate of Interest ?'))
years = int(input('Duration (no. of years) ?'))
total = (amount * pow(1 + (roi/100), years))
interest = total - amount
print('\nInterest = %0.2f' %interest)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment