print (yourname1)
snum = input('What is your date of birth (YYYYMMDD)?:')
birth1 = snum[4:6] + '/' +snum[6:8] + '/' + snum[0:4]
y1 = int(snum[0:4]) #year of person 1
m1 = int(snum[4:6]) #month ""
d1 = int(snum[6:8]) #day '"
print ('\n')
print ('\n')
sleep(1)
print (yourname2)
snum = input('What is your date of birth (YYYYMMDD)?:')
birth2 = snum[4:6] + '/' +snum[6:8] + '/' + snum[0:4]
y2 = int(snum[0:4]) #year of person 2
m2 = int(snum[4:6]) #month ""
d2 = int(snum[6:8]) #day ""
print ('\n')
print ('\n')
sleep(1)
print (birth1,', am I correct,', yourname1,'?')
sleep(1)
print ('\n')
print ('\n')
sleep(1)
print (birth2,', am I correct,', yourname2,'?')
sleep(1)
print ('\n')
print ('\n')
sleep(1)
def compare(y1, y2):
if y2 < y1:
print (yourname2, "is older than", yourname1)
elif y1 < y2:
print (yourname1, "is older than", yourname2)
else:
print (yourname1, "and", yourname2, "are the same age!")
compare(y1, y2)
This will effectively decide who is older by using the year alone. However, if a pair of people were born the same year but different month/day or same month/different day how do i tell python to compare all those factors ...
*this is a piece of code from larger program