Day Of Week

#!/usr/bin/python
#
#   dow3.py  by Verbal
#  Uses Zeller's Congruence to display the day-of-week
#
def zeller(m,d,y) :
 # m = input("Month? ")
 # d = input("  Day? ")
 # y = input(" Year? ")
 t = [ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4]

 # y -= ( m < 3 )
 if ( m < 3 ) :
   y = y - 1
 z = ( y + y/4 - y/100 + y/400 + t[m-1] + d ) % 7
 # Sun0, Mon1, Tue2, Wed3, Thr4, Fri5, Sat6
 day = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ]
 return day[z]
#
# ---- main -----
m = input("Range  1-12 Month? ")
d = input("Range  1-31   Day? ")
y = input(" Year? ")
print "Day-of-week=", zeller(m,d,y)