Message from Python discussions

December 2018

— I can do it in 2 steps

— 

Pair = pairs[2]
print(pair[1])

The logic behind that :
pair = pairs[2] = (3, ‘three’)
pair[1] is just the second element of the list “pair”

— I’m not sure if python treats these ( , ) as lists though

— Got this, in single statement though ?

— I don’t know a way of doing that

— Pair[2][1]

— Oh ok

— Nice,thanks

— One moment

— 👍

— 

import datetime
def compare_month_day(dob: str, case_dob: str) -> bool:
parse_template = "%Y-%m-%d"
_dob = datetime.datetime.strftime(dob, parse_template)
_case_dob = datetime.datetime.strftime(case_dob, parse_template)
if _dob.day == _case_dob.month:
return True

return False

Message permanent page

— Did I understand you correctly?