Skip to content
Home » Python Program to Calculate Simple Interest

Python Program to Calculate Simple Interest

Learn about Python Program to Calculate Simple Interest in the below code example. Also refer the comments in the code snippet to get a detailed view about what’s actually happening.

Python Program to Calculate Simple Interest

# Program to calculate simple interest

# inputs from user
P = float(input('Enter the principal amount: '))
R = float(input('Enter the interest rate: '))
T = float(input('Enter the time: '))

# calculate the simple interest using formula
SI = (P * R * T) / 100

# print result
print('The Simple interest = ',SI )
print('Total amount = ',( P + SI ))

Output:

Enter the principal amount: 4000
Enter the interest rate: 3
Enter the time: 7
The Simple interest =  840.0
Total amount =  4840.0

Hope above code works for you and Refer the below Related Codes to gain more insights. Happy coding and come back again.

Similar Code : Python Program to Convert Miles to Kilometers