Python Tutorial: Calculate Number of Days, Weeks, or Months to Reach Specific Goals

Поділитися
Вставка
  • Опубліковано 7 січ 2025
  • In this Python Programming Tutorial, we will be writing three different scripts to estimate how long it will take to reach certain goals. Our first script will calculate how many months it will take us to pay off a credit card. Our second script will calculate how many weeks it will take to lose a certain amount of weight. And our third script will estimate how long it will take to reach a certain number of subscribers. Let's get started...
    The code from this video can be found at:
    github.com/Cor...
    Python Datetime Tutorial: • Python Tutorial: Datet...
    ✅ Support My Channel Through Patreon:
    / coreyms
    ✅ Become a Channel Member:
    / @coreyms
    ✅ One-Time Contribution Through PayPal:
    goo.gl/649HFY
    ✅ Cryptocurrency Donations:
    Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
    Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
    Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
    ✅ Corey's Public Amazon Wishlist
    a.co/inIyro1
    ✅ Equipment I Use and Books I Recommend:
    www.amazon.com...
    ▶️ You Can Find Me On:
    My Website - coreyms.com/
    My Second Channel - / coreymschafer
    Facebook - / coreymschafer
    Twitter - / coreymschafer
    Instagram - / coreymschafer
    #Python

КОМЕНТАРІ • 43

  • @szymonwolny6124
    @szymonwolny6124 7 років тому +24

    Corey, I would like to thank you for your amazing work! Your videos are well explained and contain high-quality knowledge. Thanks to your tutorials I have changed my current job and from February I am starting working as a Junior Software Developer.
    Keep it going!
    Donation sent :)

  • @shazkingdom1702
    @shazkingdom1702 5 років тому +1

    Thank you Corey; I am happy I took the time and listened to your videos; I just want to thank you and I will continue to support you,
    All the best!

  • @seangreenlund2044
    @seangreenlund2044 5 років тому +1

    Corey you kick ass at teaching and making good videos. Just last night I decided I wanted to get into coding. I've watched many videos that show basics of it- like how to write lines and what to put in the lines for each language. However, even though those are helpful to learn what to input, you're the first to clearly show what the output is. Very satisfying to see the code actually put to work and it really helps me to understand how to apply code to real application. Love your videos. You get right to the point and explain in a very clear and concise manner. Keep it up

    • @coreyms
      @coreyms  5 років тому

      Glad you're getting into coding! Hope you enjoy it. And I'm happy to hear you find the videos helpful!

  • @timothybloxsome5802
    @timothybloxsome5802 6 років тому +3

    Great Video, as always. Thanks a lot!
    Just a minor issue though,
    using the calculations in the video here, the annual interest rate would actually exceed 0.13 per year.
    To convert an annual interest rate to an effective periodic rate (e.g. monthly rate), you don't divide by 12, instead take the 12th root.
    In this case:
    interest_charge = (((interest_rate + 1) ** (1/12)) - 1) * balance
    Thanks again for making brilliant Python lessons!

  • @AndreyLLIaBepMa
    @AndreyLLIaBepMa 7 років тому +8

    Opened the video and liked instantly. You deserve it!

    • @gesuchter
      @gesuchter 7 років тому

      Andrey Shepeta same:)

  • @THAFUYR
    @THAFUYR 4 роки тому

    This is my first time using an Import Code, now I get the whole point if using one.
    Thank you Corey !!!

  • @huzefabattiwala3106
    @huzefabattiwala3106 2 місяці тому

    Just subscribed! Excited to follow your journey to 100k subscribers and beyond! 😊

  • @rocketsamiyou
    @rocketsamiyou 6 років тому +2

    Corey, Thanks for your amazing work! All videos are well explained with high-quality.

  • @damienwayne2347
    @damienwayne2347 7 років тому +2

    Just want to say i really appreciate what you're doing here.
    thank you

  • @AdamSmith-ux5if
    @AdamSmith-ux5if 7 років тому

    Excellent video Corey! Clear explanations which make listening to your vids at 1.5x speed while driving achievable!

  • @simondekraa9264
    @simondekraa9264 4 роки тому

    If you need to perform more complex date manipulations, look at the dateutil module.
    One notable feature is the handling of months:
    # pip install python-dateutil
    from dateutil.relativedelta import relativedelta
    end_date = end_date + relativedelta(month=+1)

  • @veeranjaneyulukale2602
    @veeranjaneyulukale2602 5 років тому

    Hey man! I have gone through lot of python tutorials but you are the best i have encountered. Thank you so much for wonderful videos with such a great explanation. I have a request for you... Please post a video on calculating astronomical julian date from current date and calculating date from astronomical julian date. I saw some stuff online but no one explained in a better way. Hoping you would post video soon.

  • @MrLimgreg
    @MrLimgreg 4 роки тому +1

    Cried when he said "that was a very interesting script" 14:46

  • @hubertcombomarketing2693
    @hubertcombomarketing2693 4 роки тому +1

    Great python tutorial. Thank You.

  • @FruitloopLeviathan
    @FruitloopLeviathan 4 роки тому +2

    This is why when I changed my DS date I could speed up daycare in pokemon.

  • @tcb6550
    @tcb6550 7 років тому +1

    Thanks a lot for your time spending for us in creating videos..If possible make videos on explaining about Pandas, Numpy, Scipy and Matplotlib libraries please

  • @hossamashraf4885
    @hossamashraf4885 7 років тому +1

    man i love the way you explain stuff can you please consider doing a tutorial about gui for python like pyqt or Kivy

  • @fridax5755
    @fridax5755 6 років тому +4

    woah, i was just doing this and i realized that i have the exact same date as he does except its 2019 XD

  • @angellohector
    @angellohector 4 роки тому

    Hey thanks for the video! Is it possible to use datetime within a 5 day
    week (business week) structure, as to avoid an output of the weekend
    for example? Thanks

  • @Bryllyn
    @Bryllyn 5 років тому

    May i ask can you create a video that uses this kind of thing in a if and else python that calculate the day of numbers and a thing that accept date if its valid or not.

  • @Abhishek-nm9tm
    @Abhishek-nm9tm 7 років тому

    Is python a great choice for competative programming ? If yes then please cover data structure and algorithm in python also in your channel please. Specially dynamic programming.

  • @robinsiwach4163
    @robinsiwach4163 7 років тому

    Hey please make detailed videos on data structures and algorithms in python with their implementation

  • @partho-lia
    @partho-lia 7 років тому

    Hi Corey, I hope you are doing well, I just wanted to check with you, if you have any plan to make some tutorials on python django. Your style of teaching is extremely good.

    • @coreyms
      @coreyms  7 років тому

      Yes, I do plan on making Django and Flask tutorials. I am actually switching jobs at the moment so I am pretty busy finishing up work at my current job, but when I finish here at the end of February then I will be able to devote all of my time to finishing those videos.

    • @partho-lia
      @partho-lia 7 років тому

      Thank You Corey. Its so nice that you took time to reply. I am not sure, what you do for living. But if you are working somewhere as a full time employee and taking time out to make these videos, then you must be a super human.
      Hoping to see your tutorials on django. So, that the world can benefit out of it.

  • @samm4048
    @samm4048 5 років тому

    How would you make the same programs work, but with a user input for your fixed numbers instead? I keep getting str errors.

    • @gemini9002
      @gemini9002 5 років тому

      Kinda late but if you're getting string errors it's because the input is a string and you can't use strings for math. Use int() to covert it to an integer. Ex: int(input("whatever you want the prompt to be:"))

  • @mimo2202
    @mimo2202 7 років тому +1

    from morocco thanks

  • @evilmorty-tv1xs
    @evilmorty-tv1xs 7 років тому

    Hey Corey ,when are you gonna start the Flask Series???

    • @coreyms
      @coreyms  7 років тому +1

      I have started putting together the material for it but it is taking longer to put together since there is more to cover. I try to put out smaller videos in between so I still have content coming out while I’m working on the larger projects.

    • @evilmorty-tv1xs
      @evilmorty-tv1xs 7 років тому

      Corey Schafer Thanks man 👍

  • @benrobinson1816
    @benrobinson1816 4 роки тому +1

    hi i was wonmdering if you could help me i am trying to make a script that will display a message in 3 mounths time how would i do this this is all ihave (it is also a clock
    import easygui
    import sys
    from tkinter import*
    import time
    from datetime import datetime
    import calendar
    run = True
    easygui.msgbox("This is a clock made in python by Ben robinson", title="much cool")
    def tick():
    global tick
    time_string = time.strftime("%H:%M:%S:%a:%d:%b")#gets the current time
    clock.config(text=time_string)
    clock.after(200,tick)#after 200 millisencons tick
    while run == True:
    root = Tk()
    clock=Label(root,font=("Helvetica",50,"bold"),bg=("white"))#font colour and size of clock
    clock.grid(row=2, column=2)#colum place ment
    tick()
    root.mainloop()

  • @kapibara2440
    @kapibara2440 10 місяців тому

    It is 2024, and you have now 1,27 milion subs, 😊 wish you double that much!!!

  • @arsenalkarim2253
    @arsenalkarim2253 7 років тому +1

    Waiting for you, I'm waiting for you, I'm waiting for you. Taken for Django :'(

  • @frankconte467
    @frankconte467 7 років тому

    My output is exposing the code although the results are correct for example
    (datetime.date(2018, 3, 1), 4554.17)
    (datetime.date(2018, 3, 26), 4103.51)
    (datetime.date(2018, 4, 20), 3647.96)
    (datetime.date(2018, 5, 15), 3187.48)
    (datetime.date(2018, 6, 9), 2722.01)
    (datetime.date(2018, 7, 4), 2251.5)
    (datetime.date(2018, 7, 29), 1775.89)
    (datetime.date(2018, 8, 23), 1295.13)
    (datetime.date(2018, 9, 17), 809.16)
    (datetime.date(2018, 10, 12), 317.93)
    (datetime.date(2018, 11, 6), 0)

  • @emilio_e8204
    @emilio_e8204 6 років тому

    how do u add a input asking people what there balance, interest rate, and monthly payment is and then calculate it

  • @shadowgallery97
    @shadowgallery97 7 років тому

    A revolution without dancing is a revolution not worth having.

  • @hameedullahkhan1294
    @hameedullahkhan1294 Рік тому

    and now you got 1.23 m subscribers

  • @shazkingdom1702
    @shazkingdom1702 5 років тому +1

    Thank you Corey; I am happy I took the time and listened to your videos; I just want to thank you and I will continue to support you,
    All the best!