import datetime def searchthedate(): search_wday = "sunday" simera = datetime.date.today() for i in range(7): datedif = datetime.timedelta(days=i) thedate = simera + datedif if str(thedate.strftime('%A')).upper() == search_wday.upper(): # print(thedate.strftime('%A %d-%m-%Y')) return thedate if __name__ == '__main__': print(searchthedate())