You can use the .weekday() method of a datetime.date object
.weekday()
datetime.date
import datetime weekno = datetime.datetime.today().weekday() if weekno < 5: print "Weekday" else: # 5 Sat, 6 Sun print "Weekend"
1.4m articles
1.4m replys
5 comments
57.0k users