forked from aiti-ghana-2012/Lab_Python_01
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzellers.py
More file actions
95 lines (79 loc) · 2.47 KB
/
Copy pathzellers.py
File metadata and controls
95 lines (79 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
'''
Created on Jun 21, 2012
@author: Annor theophilus
'''
fname = raw_input('Enter your first name')
lname = raw_input('Enter your last name')
print 'Enter your date of birth'
print 'NOTE\n'
print 'for the month please enter the number that corresspond to month'
print "see below"
print 'month value'
print 'march 1\n','April 2\n','May 3\n','June 4\n','July 5'
print 'August 6\n','September 7\n','Oct 8\n','Nov 9\n','Dec 10'
print 'Jan 11\n','Feb 12\n'
month = input('month ? ')
day = input ('day ? ')
year = input('year ? ')
if month==11 or month == 12:
newyear=year+1
A= month
B= day
# computing the value value of C
turnYearstr = str(newyear)
cutYear= turnYearstr[2:]
turnYearint = int(cutYear)
C= turnYearint
# computing the value of D
cutCentury = turnYearstr[:2]
turnCenturyint =int(cutCentury)
D= turnCenturyint
else:
A= month
B= day
# computing the value value of C
turnYearstr = str(year)
cutYear= turnYearstr[2:]
turnYearint = int(cutYear)
C= turnYearint
# computing the value of D
cutCentury = turnYearstr[:2]
turnCenturyint =int(cutCentury)
D= turnCenturyint
W=(12*A-1)/5
X=(C/4)
Y=(D/4)
Z=W+X+Y+B+C-2*D
R= Z%7 # the day of the week
R=R+1
if R<0:
R=R+7
if R==0:
print fname,' ',lname,' ','was born on Sunday'
elif R==1:
print fname,' ',lname,' ','was born on Monday'
elif R == 2:
print fname,' ',lname,' ','was born on Tuesday'
elif R==3:
print fname,' ',lname,' ','was born on Wednesday'
elif R==4:
print fname,' ',lname,' ','was born on Thursday'
elif R==5:
print fname,' ',lname,' ','was born on Friday'
elif R==5:
print fname,' ',lname,' ','was born on Saturday'
else:
if R==0:
print fname,' ',lname,' ','was born on Sunday'
elif R==1:
print fname,' ',lname,' ','was born on Monday'
elif R == 2:
print fname,' ',lname,' ','was born on Tuesday'
elif R==3:
print fname,' ',lname,' ','was born on Wednesday'
elif R==4:
print fname,' ',lname,' ','was born on Thursday'
elif R==5:
print fname,' ',lname,' ','was born on Friday'
elif R==5:
print fname,' ',lname,' ','was born on Saturday'