vinay h vinay h - 1 month ago 8
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
import datetime

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

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