Python Online Compiler
Example: Python program to enter P, T, R, and calculate Compound Interest
C
C++
C#
Java
Python
PHP
main.py
STDIN
Run
# Python program to enter P, T, R, and calculate Compound Interest import math print("Enter the principal (amount), time, and rate::") p, t, r, CI = float(input()), float(input()), float(input()), None # p = principle # t = time # r = rate # CI = compound interest # Calculate compound interest CI = p * (math.pow((1 + r / 100), t)) # Output print("Compound Interest = ", CI)
5 7 9
Output
Clear
ADVERTISEMENTS