vinay h vinay h - 9 months ago 55
Python Question

how to find current day is weekday or weekends in Python?

Please suggest me on the following.
How to find whether a particular day is weekday or weekend in Python?

Answer Source
import datetime

weekno = datetime.datetime.today().weekday()

if weekno<5:
    print "Weekday"
else:
    print "Weekend"