I have a below list,
e= [datetime.date(2011, 3, 12),
datetime.date(2014, 3, 12),
datetime.date(2021, 12, 12)]
And want to write a program that would check if a given date say in a function when passed, is able to check whether the date is present inside this list or not.
Here is a sample code I am trying:
def defd(a,b,c):
if datetime.date(a,b,c)==e:
print('Date exists')
else:
print('Date doesnt exists')
defd(2014,3,12)
The o/p is showing date doesnt exists, can you let me know where am i going wrong?