Practice #25: Count the number of Friday 13th in the given year _ Python Coding for Beginners

Поделиться
HTML-код
  • Опубликовано: 21 окт 2024

Комментарии • 14

  • @makeeverydayezday7438
    @makeeverydayezday7438  2 года назад

    This is a very basic practice with Python datetime module and date() class function. To create a date, we can use the date() class (constructor) of the datetime module. The date() class requires three parameters to create a date: year, month, day.

  • @philworley6336
    @philworley6336 2 года назад +2

    I like the way you write the one-line sum function code. It's also my preferred of doing the counting. Cheers!

  • @tsudashiro8045
    @tsudashiro8045 2 года назад

    In 'strftime,' the 'f' is for 'format,' and in 'strptime,' the 'p' is for 'parse.' Knowing this helps you remember them better. Great video by the way.

  • @tombray3797
    @tombray3797 2 года назад

    Love the explanation. Simple and easy to follow. I was confused about conversion between datetime and string objects until i saw ur video. Just wanted to say thanks

  • @dennisirwin3833
    @dennisirwin3833 2 года назад

    Hi, I am doing the Python exercise: "how many times so far your birthday has fallen on a Saturday."
    And thanks to your approach in this video, I solved mine easily. Thanks a ton buddy!!!!!

  • @joomla5507
    @joomla5507 2 года назад

    Hi, I've got a question: I see that I can create a datetime object by using datetime(year, month, date) or date(year, month, date). So what are the differences between these two functions? Thanks in advance!

    • @makeeverydayezday7438
      @makeeverydayezday7438  2 года назад

      with datetime() function, you can add more elements like hour, minute, second

  • @timothyleary700
    @timothyleary700 2 года назад

    To whom might be interested:
    how to combine date and time together:
    import datetime, date, time
    # (hours, minutes)
    _time = time(7, 0)
    # (year, month, day)
    _date = date(2018, 6, 11)
    # Create a datetime object
    _datetime = datetime.combine(_date, _time)