Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pytthon how many fridays´ between two dates

from datetime import  date

d1 = date(2017, 1, 4)
d2 = date(2017, 1, 31)

count = 0

for d_ord in range(d1.toordinal(), d2.toordinal()):
    d = date.fromordinal(d_ord)
    if (d.weekday() == 4):
        count += 1

print(count)
Comment

PREVIOUS NEXT
Code Example
Python :: how to open pygame 
Python :: python obfuscator github 
Python :: python telegram bot login 
Python :: List comprehension if-else 
Python :: netcdf in python 
Python :: check datatype python 
Python :: python for loop index 
Python :: read a function of excel in python 
Python :: handwritten digits data set 
Python :: latest version of python 
Python :: staticmethod python 
Python :: math module in python 
Python :: pil format multiline text 
Python :: create array of specific size python 
Python :: python for dummies 
Python :: how to numbered jupyter notebook 
Python :: color plt 
Python :: python get file line count 
Python :: merge 2 dataframes in python 
Python :: python find first occurrence in list 
Python :: django authenticate with email 
Python :: flask No application found. Either work inside a view function or push an application context 
Python :: get index of dataframe 
Python :: python gaussian filter 
Python :: fernet in python 
Python :: dict column to be in multiple columns python 
Python :: pdf to string python 
Python :: delete element from matrix python 
Python :: pandas if value present in df index 
Python :: list out the groups from groupby 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =