Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

holidays python

# Please subscribe my channel - https://bit.ly/PROGRAMMING-HERO

# pip install holidays
from datetime import date
import holidays
  
# Select country
uk_holidays = holidays.UnitedKingdom()
  
# If it is a holidays then it returns True else False
print('01-01-2018' in uk_holidays)
print('02-01-2018' in uk_holidays)
  
# What holidays is it?
print(uk_holidays.get('01-01-2018'))
print(uk_holidays.get('02-01-2018'))

# For more info - https://www.geeksforgeeks.org/python-holidays-library/
# NOTE - The above code is from the geeksforgeeks, This is just to give you an example of holidays module
 
PREVIOUS NEXT
Tagged: #holidays #python
ADD COMMENT
Topic
Name
3+7 =