KnowledgeBoat Logo
|

Computer Applications

What will be output of the following code if the user enters Principal amount as 20000 and Time as 10 years.

#Considering Python 2.7 
P = input("Enter Principal amount:") 
T = input("Enter Time:") 
if T > 10: 
SI = P*T*10/100 
else: 
SI = P*T*15/100 
print("Simple Interest = ", SI) 

Python Control Flow

1 Like

Answer

Enter Principal amount:20000
Enter Time:10
Simple Interest =  30000

Working

This Python program calculates the Simple Interest (SI) based on the given Principal amount (P) and Time (T) values. For time value of more than 10 years, the program takes the rate of interest as 10% and for 10 years or less it takes the rate of interest as 15%.

Answered By

2 Likes


Related Questions