#Program to find your Day of Birth given Date of Birth
#indent and syntax problem may occur for different IDE
-def main():
d=input("Enter your date")
m=input("Enter your month in mm format")
y=input("Enter your year in yyyy format")
- if( d>31 or m>12 or (y<1900 or y>=2000) ):
print('INVALID INPUT')
year = y-1900
year = year/4
year = year+y-1900
- if m==1 or m==10:
month = 1
- elif m==2 or m==3 or m==11:
month = 4
- elif m==4 or m==7:
month = 0
- elif m==5:
month = 2
- elif m==6:
month = 5
- elif m==8:
month = 3
- elif m==9 or m==12:
month = 6
year = year+month
year = year+d
day = year%7
- if day==0:
print('Day is SATURDAY')
- elif day==1:
print('Day is SUNDAY')
- elif day==2:
print('Day is MONDAY')
- elif day==3:
print('Day is TUESDAY')
- elif day==4:
print('Day is WEDNESDAY')
- elif day==5:
print('Day is THURSDAY')
- elif day==6:
print('Day is FRIDAY')
- main()
No comments:
Post a Comment