我有一个函数,它可以创建一个字典,如下所示。
x = {'filename': {'filetype': ('5/6/2019', '12/31/2019')}, 'filename2': {'filetype': ('3/24/2018', '5/6/2019')}}
我需要通过传递日期及其类型来创建一个新函数,以根据元组日期返回文件名。
def fn(date, filetype):
I'm trying to pass a date as a first argument
and the date should check if it is in between the tuple as start and end dates
in the dictionary values above If it is in between those dates I need to return the file name
return filename
问题:
是否可以检查元组的中间日期?