OP wants to create a datetime.datetime object. Why complicate things with creating string and then convert it to datetime.datetime object?
import datetime year = 2018 month = 8 day = 6 my_datetime = datetime.datetime(year=year, month=month, day=day) print(my_datetime.strftime('%A'))
Output:Monday
>>>
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs