ความคิดเห็น •

  • @BroCodez
    @BroCodez ปีที่แล้ว +28

    # 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 ปีที่แล้ว +2

      Why define the variables equal to zero?

    • @mohab4869
      @mohab4869 ปีที่แล้ว +2

      @@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 ปีที่แล้ว +9

    OMG back from 3 months
    My fav teacher
    Keep going BRO

  • @tanh4219
    @tanh4219 ปีที่แล้ว +10

    Make more machines like this please! It's so educating

  • @hemant6271
    @hemant6271 ปีที่แล้ว +3

    thanks for explaining so nice the way you teach makes me more interested in your videos warm wishes from INDIA

  • @Afghanistanfutsalfans
    @Afghanistanfutsalfans ปีที่แล้ว

    It has been a few days since having started watching your videos. you are the best!

  • @LordoofGaming1
    @LordoofGaming1 ปีที่แล้ว +1

    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

  • @tara2337
    @tara2337 7 หลายเดือนก่อน +2

    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 4 หลายเดือนก่อน

      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

  • @tripphouse8165
    @tripphouse8165 ปีที่แล้ว +1

    Im actually making a compound interest app with future value of a series in JS for one of my portfolio projects : )

  • @joncaldwell4753
    @joncaldwell4753 2 หลายเดือนก่อน

    It's great to see you with so many subs

  • @chineduogoliegbune5227
    @chineduogoliegbune5227 ปีที่แล้ว +1

    I think I prefer the 'While True' function in python, it's a lot easier to understand

  • @sunrise4439
    @sunrise4439 ปีที่แล้ว

    Living legend Teacher... GBU Mr. Bro

  • @WINDOWSUSER-q4s
    @WINDOWSUSER-q4s 10 หลายเดือนก่อน

    NICELY DONE BRO...❤

  • @Dr_piFrog
    @Dr_piFrog 2 หลายเดือนก่อน

    This is not the major objective of this video, but adding a "comma" before the ".2f" to add separator for larger values.
    print(f"Balance after {time} years: ${total:,.2f}")

  • @RaajaNaagaLingam
    @RaajaNaagaLingam ปีที่แล้ว +1

    How did the system know how to calculate the interest?

    • @rottenspilledbeans
      @rottenspilledbeans ปีที่แล้ว +1

      Because you program it to calculate compound interest.

  • @thecarzyguyyy9692
    @thecarzyguyyy9692 ปีที่แล้ว

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

  • @danielhod53
    @danielhod53 ปีที่แล้ว +1

    hey Bro, what keyboard and mouse are you using?

    • @MrSwaga1
      @MrSwaga1 ปีที่แล้ว +1

      I was thinking the same same thing because he was like clickety clack clack all the way through the video lol

  • @mywhiteplume
    @mywhiteplume ปีที่แล้ว +1

    How would we modify the rates to accept decimal values?

    • @rottenspilledbeans
      @rottenspilledbeans ปีที่แล้ว +1

      The program accepts decimal values as long as you you have included float in the program instead of int.

    • @anvrag
      @anvrag ปีที่แล้ว +1

      instead of int, use float typecast.

  • @chrisbwelesi3243
    @chrisbwelesi3243 ปีที่แล้ว

    Very interesting

  • @Sadad_Mahmud_Miad
    @Sadad_Mahmud_Miad 10 หลายเดือนก่อน +1

    Bro is Teaching Math secretly

  • @ItzSomething634
    @ItzSomething634 9 หลายเดือนก่อน

    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

  • @bjrn-magnekristensen2444
    @bjrn-magnekristensen2444 11 หลายเดือนก่อน

    my take on it:
    def intrest_calculator():
    principle = 0
    rate = 0
    time = 0
    while principle

  • @dragonslayerryu1
    @dragonslayerryu1 ปีที่แล้ว +3

    wait, isn't the formula of compound interest p(1+r/n)^tn? but you did p(1+r)^t

    • @tommasotiberi5666
      @tommasotiberi5666 6 หลายเดือนก่อน +1

      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 6 หลายเดือนก่อน

      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

  • @sizza5766
    @sizza5766 หลายเดือนก่อน

    this isn't a compounding calculation your missing N , number of compounding periods

  • @mustafarasool7591
    @mustafarasool7591 ปีที่แล้ว

    hi , i did not get why you add true

  • @RaajaNaagaLingam
    @RaajaNaagaLingam ปีที่แล้ว +5

    It's Principal not Principle!

  • @isaiahlacuarin3653
    @isaiahlacuarin3653 ปีที่แล้ว

    bro this is simple Interest

  • @Lit35
    @Lit35 9 หลายเดือนก่อน

    i hate math