python - Stuck at comparing date of birth in the form yyyy/mm/dd -


i new around , wanted make simple program compare date of births. far have block of code

y1 = int(input("enter year of birth of person 1 in form of yyyy"+" "))  m1 =int(input("enter month of birth of person 1 in form of mm"+" "))   d1 =int(input("enter day of birth of person 1 in form of dd"+" "))  y2 = int(input("enter year of birth of person 2 in form of yyyy"+" "))  m2 =int(input("enter month of birth of person 2 in form of mm"+" "))   d2 =int(input("enter day of birth of person 2 in form of dd"+" ")) 

i can manage compare dates of birth long year of birth different.i have no clue how write code if year of birth same compare month of birth.if month of birth same compare day of birth , print out accordingly.tried searching around google no luck specific question,only similar ones.

keep in mind barely know how open python gui idle , save projects not able understand difficult answers if reference more in depth knowledge of python.

you can compare tuples of 3 values!

(y1, m1, d1) < (y2, m2, d2) 

first, checks whether y1 < y2. if equal, checks whether m1 < m2, , on.

>>> (2001, 3, 13) < (2002, 3, 14) true >>> (2001, 3, 13) < (2001, 3, 12) false 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -