Python Check if Today is Friday or not Example
Published On: 29/09/2022 | Category:
Python

Hi Guys,
In this quick example, let's see how to check if today is friday in python. This article goes in detailed on python check date is friday or not. Here you will learn python check date is friday. you will learn how to check if today is friday in python. follow bellow step for python today is friday.
In this example, we will use DateTime library to check whether today is Tuesday or not. I will give you two simple examples one using weekday() and another using isoweekday(). so let's see both examples:
You can use these examples with python3 (Python 3) version.
So let's see bellow example:
Example 1:
main.pyfrom datetime import datetime # If today is Friday (0 = Mon, 1 = Tue, 2 = Wen ...) if datetime.today().weekday() == 4: print("Yes, Today is Friday") else: print("Nope...")Output:
Yes, Today is Friday
Example 2:
main.pyfrom datetime import datetime # If today is Friday (1 = Mon, 2 = Tue, 3 = Wen ...) if datetime.today().isoweekday() == 5: print("Yes, Today is Friday") else: print("Nope...")Output:
Yes, Today is Friday
It will help you....
Happy Pythonic Coding!