So, finally, you began Python programming, That’s great. As a result, problems were bound to occur and here you are, stuck on one. Finding simple interest has been one of the easiest topics in Maths but not so much while coding.
Don’t worry, with the emergence of the internet, the solutions to all your problems are available at your fingertips.
Python as a calculator?
Python is a high level, object-oriented, interpreted language which has an easy syntax and dynamic semantics. It is way much easier than other programming languages like C and C++ and helps you create wonderful applications with less effort and much more ease.
Even though Python makes complex tasks seem easy, it makes easy tasks seem easier. Python has been widely used as a means to eradicate mathematical problems and it sure does work as a calculator!
Finding Simple Interest
Let’s start with the basics.
The formula for simple interest is:
Simple Interest = (P * R * T)/100 where P stands for Principal Amount, R stands for Rate of Interest, and T stands for Time in Years.
For example,
We need to find simple interest on Rs. 1,000 at the rate of 10% for 5 units of time. Answer: P=1,000 R=10 T=5 So, S.I. = 1000*10*5/100 => 500.
Python code for Simple Interest
So, there are many ways to solve this problem but I’ll be showing you two ways to approach this problem.
Method 1: Simple Input/Output
Method 2: Simple Interest as a function
Go ahead and try the codes for yourself. I tried my best to keep it short and simple but you’re free to explore new ways to tackle this problem or any problem in that sense.
If the fundamentals are clear to you, the code will itself come to you, you just have to read between the lines.
Final Words
The key to excelling in Python Programming is to keep practicing, keep coding, clear your doubts immediately and you’ll be a pro in no time.
Furthermore, if you have any more doubts, feel free to contact experts at WhatAfterCollege.com. We’re always here to help you.
Thank you and ALL THE BEST!
All you need to know about Python Programming
Learn Python Programming
Top 7 Python Programming University/ Colleges in India | Top 7 Training Institutes of Python Programming |
Top 7 Online Python Programming Training Programs | Top 7 Certification Courses of Python Programming |
Learn Python Programming with WAC
Other Skills in Demand(H3)
Artificial Intelligence | Data Science |
Digital Marketing | Business Analytics |
Big Data | Internet of Things |
Python Programming | Robotics & Embedded System |
Android App Development | Machine Learning |