Day of the week

Report a typo

In the topic, we haven't covered all possible codes you can use in the format strings. One such code is %A, which represents the full name of the weekday: Sunday, Monday, and so on.

Write a function get_weekday that takes a datetime object and returns the string containing the corresponding weekday.

Note that you do NOT need to read the input, call the function, or print the result. Input and output examples are provided for you to test your code.

Sample Input 1:

2014-11-08

Sample Output 1:

Saturday

Sample Input 2:

2019-12-31

Sample Output 2:

Tuesday
Write a program in Python 3
from datetime import datetime


def get_weekday(datetime_obj):
...
___

Create a free account to access the full topic