I have a scenario where i want to fetch dates of last week of every month and store it to set
For example :
Let's assume this 2 parameter as Input : Todays month is JUL
and current date date.today()
My code :
from datetime import date
from datetime import timedelta
def fetchLastWeekdate(month_name,current_date):
today = date.today()
for i in range(0,7):
print (today - timedelta(days=i))
Printing Output :
2021-07-25
2021-07-24
2021-07-23
2021-07-22
2021-07-21
2021-07-20
2021-07-19
Expected Output :
But I need expected Output as following -> 25,26,27,28,29,30,31
as set
my_last_week_set = {25,26,27,28,29,30,31}
current_date
if you aren't going to use it? Actually, why do you have any parameters since you don't use them?