Simple interest
Class 11 Computer Science · Expressions and Input/Output · Write the program · 3 marks
- Read the question and the sample tests.
- Write your Python program in the editor.
- Run Code to check it on the sample tests (no marks).
- Submit Answer for evaluation: hidden tests award the marks. Nothing is saved here.
Question
Write a program that reads the principal P, the rate of interest R (per cent per year) and the time T (in years), each an integer on its own line, and prints the simple interest calculated as P × R × T / 100. Input: three lines, P, R and T. Output: exactly one line in the form Simple Interest: SI
Sample tests
Use these examples to check your program. Your output must match the Expected Output exactly.
1000 5 2
Simple Interest: 100.0
1500 4 3
Simple Interest: 180.0
Evaluation: when you submit, your program is also checked against 3 hidden tests that you cannot see. Marks come from the hidden tests only. Each test you pass earns its marks, so a partly correct program gets part marks. Prompt text passed to input() is not counted as output.
Your program
Write the whole program, including any import lines it needs. The editor starts empty; Reset Code clears it. Submit your answer before leaving the page.
Approach (open it after you have tried)
Convert each input line to int with int(input()), then apply the formula P * R * T / 100. The / operator always gives a float in Python, so 1000, 5 and 2 give 100.0, not 100. print() with a comma puts one space between the label and the value.
Practise all 65 Class 11 programs
This page has 10 programs. The complete Class 11 Python Lab has 65, and keeps your best score and chapter progress.
Other Class 11 programs: Grade from marks · Prime or composite · Alternating series · Right triangle of stars · Palindrome string · Linear search in a list · Search in a tuple · Character frequency with a dictionary · Circle with the math module