Week number of the year

Report a typo

In the topic, we didn't cover all the format codes. Check out the official documentation to find the code used to format the week number of the year (assuming that Sunday is the first day of the week).

Write a function get_week_number that takes a datetime object and returns the string "Week number: {num}." where num represents the week number.

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

Sample Input 1:

2021-8-4

Sample Output 1:

Week number: 31.
Write a program in Python 3
from datetime import datetime


def get_week_number(datetime_obj):
...
___

Create a free account to access the full topic