Created
March 27, 2018 06:46
-
-
Save sharuzzaman/414f196a6ce003a2e76bc560e9192560 to your computer and use it in GitHub Desktop.
total working day in a month
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python | |
import calendar | |
import datetime | |
now = datetime.datetime.now() | |
cal = calendar.Calendar() | |
working_days = len([x for x in cal.itermonthdays2(now.year, now.month) if x[0] !=0 and x[1] < 5]) | |
print "Total working days this month: " + str(working_days) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment