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

Hi Guys,
In this tutorial, you will learn python check date is monday or not. you can understand a concept of how to check if today is monday in python. I would like to show you how to check if today is monday in python. I’m going to show you about python today is monday. Let's see bellow example check today is monday in python.
In this example, we will use DateTime library to check whether today is Monday 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: Python Check Today's Date is Weekend or Weekday
main.pyfrom datetime import datetime # If today is Monday (0 = Mon, 1 = Tue, 2 = Wen ...) if datetime.today().weekday() == 0: print("Yes, Today is Monday") else: print("Nope...")Output:
Yes, Today is Monday
Example 2: Python Check String Date is Weekend or Weekday
main.pyfrom datetime import datetime # If today is Monday (1 = Mon, 2 = Tue, 3 = Wen ...) if datetime.today().isoweekday() == 1: print("Yes, Today is Monday") else: print("Nope...")Output:
Yes, Today is Monday
It will help you....
Happy Pythonic Coding!