human
I found an interesting problem on https://www.codewars.com/kata/58e4033b5600a17be1000103:
Hi guys, welcome to introduction to DocTesting.

The kata is composed of two parts.
in part (1) we write three small functions, and in part (2) we write a few doc tests for those functions.

Lets talk about the functions first...

    The reverse_list function takes a list and returns the reverse of it.
    If given an empty list, simply return an empty list.

The second function...

    The sum_list function takes a list as input and adds up all the values, 
    returning an integer. If the list is empty, return 0.

The third function...

    The head_of_list function simply returns the first item in the list.
    If the list is empty return None.

Each of these functions can be easily written with a single line of code.
there are some tests for correctness but no tests for effciency.

Once you have implemented all three of these functions you can move onto phase two, which is writing doc tests. If you haven't written doc tests before then I suggest you check out the following documentation: 
https://docs.python.org/3/library/doctest.html

To complete this kata all you have to do is write **EXACTLY TWO** doc tests for each of the three functions (any more/less than that and you will fail the tests).

Here is an example:

    def double(y):
      """Function returns y * 2
      >>> double(2)
      4
      """
      return y * 2

In the example above we have a function called 'double' and a single doctest. When we run the doctest module Python will check if double(2) equals 4. If it does not, then the doctest module will flag up an error.

Please note that this is intended as a beginners introduction to docstrings, if you try to do something clever (such as writing doc tests to catch exceptions, or tinkering with the 'option flags'), you will probably fail a test or two. This is due to how the tests are written.  

Oh and one last thing, don't try and get too 'cheeky' and try something like:
    
    """
    >>> True
    True
    """

such a solution is (a) not in the spirit of things and (b) I got tests for...

I tried it in Python, but could not do it. Can you solve it?

What is a the Python code you requested?
assistant
#Here is the Python code you requested.

def reverse_list(x):
    """Takes an list and returns the reverse of it. 
    If x is empty, return [].
    
    >>> reverse_list([])
    []
    >>> reverse_list([5, 4,3, 2, 1])
    [1, 2, 3, 4, 5]
    """ 
    return x[::-1]

def sum_list(x):
    """Takes a list, and returns the sum of that list.
    If x is empty list, return 0.

    >>> sum_list([])
    0
    >>> sum_list([1, 2, 3, 4, 5])
    15
    """
    return sum(x)

def head_of_list(x):
    """Takes a list, returns the first item in that list.
    If x is empty, return None

    >>> head_of_list([]) is None
    True
    >>> head_of_list([1, 2, 3, 4, 5])
    1
    """ 
    return x[0] if x else None