I am getting an exception when I run the following code which I can not explain:
import datetime
datetime.datetime.strptime("2018-04-02", format = "%Y-%m-%d")
TypeError: strptime() takes no keyword arguments
Remove the format =
keyword, the second argument is positional only:
>>> import datetime
>>> datetime.datetime.strptime("2018-04-02", "%Y-%m-%d")
datetime.datetime(2018, 4, 2, 0, 0)