Python compound interest calculator 💰

  Рет қаралды 34,993

Bro Code

Bro Code

Жыл бұрын

#Python #tutorial #course
Python compound interest calculator tutorial example explained

Пікірлер: 35
@BroCodez
@BroCodez Жыл бұрын
# Python compound interest calculator principle = 0 rate = 0 time = 0 while True: principle = float(input("Enter the principle amount: ")) if principle < 0: print("Principle can't be less than zero") else: break while True: rate = float(input("Enter the interest rate: ")) if rate < 0: print("Interest rate can't be less than zero") else: break while True: time = int(input("Enter the time in years: ")) if time < 0: print("Time can't be less than zero") else: break total = principle * pow((1 + rate / 100), time) print(f"Balance after {time} year/s: ${total:.2f}")
@atalgill5587
@atalgill5587 10 ай бұрын
Why define the variables equal to zero?
@mohab4869
@mohab4869 10 ай бұрын
@@atalgill5587 Because if we didn't put these variables before the while loop except (while True) python will give us an error cuz its not defined before , so we put these variables before it with zero value and user will overwrite the zero I hope that was useful :)
@arbjonmarasheviq6710
@arbjonmarasheviq6710 Жыл бұрын
OMG back from 3 months My fav teacher Keep going BRO
@tanh4219
@tanh4219 Жыл бұрын
Make more machines like this please! It's so educating
@afghanlearners9505
@afghanlearners9505 Жыл бұрын
It has been a few days since having started watching your videos. you are the best!
@hemant6271
@hemant6271 Жыл бұрын
thanks for explaining so nice the way you teach makes me more interested in your videos warm wishes from INDIA
@sunrise4439
@sunrise4439 Жыл бұрын
Living legend Teacher... GBU Mr. Bro
@ahmadabdelmonem7692
@ahmadabdelmonem7692 8 ай бұрын
Thanks BroCodez, You are the best!!!
@tripphouse8165
@tripphouse8165 Жыл бұрын
Im actually making a compound interest app with future value of a series in JS for one of my portfolio projects : )
@user-ly5we6xl4v
@user-ly5we6xl4v 6 ай бұрын
NICELY DONE BRO...❤
@chrisbwelesi3243
@chrisbwelesi3243 Жыл бұрын
Very interesting
@chineduogoliegbune5227
@chineduogoliegbune5227 9 ай бұрын
I think I prefer the 'While True' function in python, it's a lot easier to understand
@ItzSomething634
@ItzSomething634 5 ай бұрын
i wish he wrote out the exercise with a rough guide on how to do the questions before we watch the video instead of just walking us through it straight away
@LordoofGaming1
@LordoofGaming1 8 ай бұрын
can you hulp ? with coding a program based on standard value table loan interest rate, initial initial value basic installment values you will calculate the value received in each subsequent for the next 2 years plss
@darkshadowgamer401
@darkshadowgamer401 5 ай бұрын
Bro is Teaching Math secretly
@tara2337
@tara2337 3 ай бұрын
great job man! thank you so much! I just don't get why you use an if inside a while loop with the same condition, well, if we get inside the while loop, it's obvious that the condition is true and we won't need to check it again by using the if function🤔
@AmaraMySon-ob8yy
@AmaraMySon-ob8yy Күн бұрын
Exactly. Can't we just print the warning inside the while loop and then give the user a chance to leave the loop by repeating the initial function? If you get what I mean
@bjrn-magnekristensen2444
@bjrn-magnekristensen2444 7 ай бұрын
my take on it: def intrest_calculator(): principle = 0 rate = 0 time = 0 while principle
@danielhod53
@danielhod53 Жыл бұрын
hey Bro, what keyboard and mouse are you using?
@MrSwaga1
@MrSwaga1 8 ай бұрын
I was thinking the same same thing because he was like clickety clack clack all the way through the video lol
@thecarzyguyyy9692
@thecarzyguyyy9692 7 ай бұрын
I dont really understand the While True code, isn't 0 False? And what does it based to be True? pls explain to me thx.🙏🙏🙏🙏
@mywhiteplume
@mywhiteplume Жыл бұрын
How would we modify the rates to accept decimal values?
@rottenspilledbeans
@rottenspilledbeans Жыл бұрын
The program accepts decimal values as long as you you have included float in the program instead of int.
@anvrag
@anvrag 11 ай бұрын
instead of int, use float typecast.
@RaajaNaagaLingam
@RaajaNaagaLingam Жыл бұрын
How did the system know how to calculate the interest?
@rottenspilledbeans
@rottenspilledbeans Жыл бұрын
Because you program it to calculate compound interest.
@mustafarasool7591
@mustafarasool7591 Жыл бұрын
hi , i did not get why you add true
@rottenspilledbeans
@rottenspilledbeans Жыл бұрын
true here means the value is not negative.
@timashot3286
@timashot3286 Жыл бұрын
wait, isn't the formula of compound interest p(1+r/n)^tn? but you did p(1+r)^t
@tommasotiberi5666
@tommasotiberi5666 Ай бұрын
That's right, the formula has 'n' (number of times interest is compounded per year) at the exponent as well...then he just deals with the case n=1 since it's yearly interest: weekly interest would be with n=52, daily with n=365, monthly with n=12, ecc...
@tommasotiberi5666
@tommasotiberi5666 Ай бұрын
Btw the factor 100 he has at the denominator in the line where he defines the total comes from the percentage conversion: if R=3% then r=R/100=0.03
@isaiahlacuarin3653
@isaiahlacuarin3653 Жыл бұрын
bro this is simple Interest
@RaajaNaagaLingam
@RaajaNaagaLingam Жыл бұрын
It's Principal not Principle!
@Lit35
@Lit35 5 ай бұрын
i hate math
For loops in Python are easy 🔁
5:06
Bro Code
Рет қаралды 233 М.
Python lists, sets, and tuples explained 🍍
15:06
Bro Code
Рет қаралды 221 М.
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 38 МЛН
Joven bailarín noquea a ladrón de un golpe #nmas #shorts
00:17
Eccentric clown jack #short #angel #clown
00:33
Super Beauty team
Рет қаралды 13 МЛН
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1 МЛН
Simple GUI Calculator in Python
22:51
NeuralNine
Рет қаралды 236 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,7 МЛН
Python email slicer exercise 📧
3:46
Bro Code
Рет қаралды 34 М.
Format specifiers in Python are awesome 💬
5:21
Bro Code
Рет қаралды 61 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 301 М.
Python GUI radiobuttons 🔘
12:22
Bro Code
Рет қаралды 21 М.
Python dictionaries are easy 📙
8:06
Bro Code
Рет қаралды 188 М.
Python multithreading 🧵
13:34
Bro Code
Рет қаралды 60 М.
I PEELED OFF THE CARDBOARD WATERMELON!#asmr
00:56
HAYATAKU はやたく
Рет қаралды 38 МЛН