def Validate_Birthday(self, Given_Birthday, Given_Age): output = False error = "" clean = Cleaner() result = clean.Clean_Birthday(Given_Birthday) #Checks to see if the birthday was cleaned if (result[0] != None): if (result[1] == ""): date_Details = result[0].split("-") str_Day = date_Details[0] str_Month = date_Details[1] str_Year = date_Details[2] try: given_Birth_Date = datetime.date(int(str_Year), int(str_Month), int(str_Day)) today = datetime.datetime.now() should_Be_Age = today.year - given_Birth_Date.year - ( (today.month, today.day) < (given_Birth_Date.month, given_Birth_Date.day)) if should_Be_Age == Given_Age: output = True else: error = "The age given and birthday do not line up" except: error = "Birthday is not a valid date" else: error = result[1] else: error = "Birthday wasnt not in a logical format" return output, error