JTB1979

zellers.py

Jun 28th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.95 KB | None | 0 0
  1. # Name: James Taylor-Bye
  2. # Section: MechanicalMooc Week 2
  3. # Date: 27/06/13
  4. # zellers.py
  5.  
  6.  
  7. print "Enter your date of birth : "
  8. print "Jan = 11 , Feb = 12 , Mar = 1 , Apr = 2 .... Dec = 12"
  9. a = raw_input ("Month? ")
  10. b = raw_input ("Day? ")
  11. c = raw_input ("Year of the century e.g. 79 for the year 1979 ")
  12. d = raw_input ("Century e.g. 19 for the year 1979 ")
  13.  
  14. if a == 11 or a == 12:
  15.     c = c -1
  16.  
  17.     print c
  18.    
  19. w = (13 * a - 1 ) / 5
  20. x = c / 4
  21. y = d / 4
  22. z = w + x + y + b + c - 2 * d
  23. r = z % 7
  24.  
  25. print r
  26.  
  27. if r == 0:
  28.     print ("The day was a Sunday.")
  29. elif r == 1:
  30.         print "The day was a Monday"
  31. elif r == 2:
  32.         print "The day was a Tuesday"
  33. elif r == 3:
  34.         print "The day was a Wednesday"
  35. elif r == 4:
  36.         print "The day was a Thursday"
  37. elif r == 5:
  38.         print "The day was a Friday"
  39. elif r == 6 :
  40.         print "The day was a Sunday"
  41.  
  42. print " "
  43. date = "Please enter a date in the following format dd/mm/yyyy :"
Advertisement
Add Comment
Please, Sign In to add comment