Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Name: James Taylor-Bye
- # Section: MechanicalMooc Week 2
- # Date: 27/06/13
- # zellers.py
- print "Enter your date of birth : "
- print "Jan = 11 , Feb = 12 , Mar = 1 , Apr = 2 .... Dec = 12"
- a = raw_input ("Month? ")
- b = raw_input ("Day? ")
- c = raw_input ("Year of the century e.g. 79 for the year 1979 ")
- d = raw_input ("Century e.g. 19 for the year 1979 ")
- if a == 11 or a == 12:
- c = c -1
- print c
- w = (13 * a - 1 ) / 5
- x = c / 4
- y = d / 4
- z = w + x + y + b + c - 2 * d
- r = z % 7
- print r
- if r == 0:
- print ("The day was a Sunday.")
- elif r == 1:
- print "The day was a Monday"
- elif r == 2:
- print "The day was a Tuesday"
- elif r == 3:
- print "The day was a Wednesday"
- elif r == 4:
- print "The day was a Thursday"
- elif r == 5:
- print "The day was a Friday"
- elif r == 6 :
- print "The day was a Sunday"
- print " "
- date = "Please enter a date in the following format dd/mm/yyyy :"
Advertisement
Add Comment
Please, Sign In to add comment