Python
How To Check If Today Is Saturday Or Not In Python?
This simple article demonstrates of python check date is saturday. step by step explain how to check if today is saturday in python. I explained simply about how to check if today is saturday in python. if you want to see example of python today is saturday then you are a right place.
- TAGS
- Python
- 4.5/5.0
- Last updated 08 September, 2022
- By Admin
In this example, we will use DateTime library to check whether today is Saturday 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
Example 1:
main.py
from datetime import datetime # If today is Saturday (0 = Mon, 1 = Tue, 2 = Wen ...) if datetime.today().weekday() == 5: print("Yes, Today is Saturday") else: print("Nope...")
Output
Yes, Today is Saturday
Example 2:
main.py
from datetime import datetime # If today is Saturday (1 = Mon, 2 = Tue, 3 = Wen ...) if datetime.today().isoweekday() == 6: print("Yes, Today is Saturday") else: print("Nope...")
Output
Yes, Today is Saturday
I hope it can help you...
Categories
PHP
(5)
Codeigniter
(5)
Laravel
(3)
JS
(1)
Angular JS
(5)
Node JS
(5)
Vue JS
(4)
React JS
(6)
jQuery
(5)
Javascript
(3)
jQuery UI
(6)
Wordpress
(1)
Python
(5)
Database
(1)
MySql
(5)
Mongo DB
(1)
DBMS
(1)
SQL
(5)
HTML
(1)
HTML 5
(5)
CSS
(5)
Bootstrap
(5)
Ajax
(5)
JAVA
(1)
JSON
(5)
Ubuntu
(5)
Server
(5)
Git
(3)
Google
(1)
Google Map
(7)
Google API
(1)
Elastic Search
(1)
Apache
(1)
Installation
(1)