I have a function stored into variable and I would like to execute that one into dictionary. Is it possible in Python?
import datetime
x = datetime.date(2021, 8, 23)
item = {
"dt": x
}
print(item)
Obtained result: {'dt': datetime.date(2021, 8, 23)}
Wanted result: {'dt': '2021-08-23'}
How to do?