Python - Standard Library Usage
Which of the following is the correct way to create a date object for January 1, 2024 using the datetime module?
date class constructor takes year, month, day as integers in that order.datetime.date(2024, 1, 1). date = datetime(2024, 1, 1) misses .date. date = datetime.date('2024-01-01') passes a string, which is invalid. date = datetime.date(1, 1, 2024) has wrong argument order.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions