CBSE Class 10 Computer Applications Question 23 of 26

Python Conditionals and Loops — Question 14

Back to all questions
14
Question

Question 10

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) 
Answer
Output
Enter Principal amount:20000
Enter Time:10
Simple Interest =  30000
Explanation

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%.