import keyword


def pykeyword(operation='list', keywordtotest=None):
    """

    Check if a keyword exists in the Python keyword dictionary

    operation:
    Whether to list or check the keywords. Possible options are list and check. The default is 'list'.

    keywordtotest:
    The keyword to test for if the operation is 'check'. The default is None.

    """

    if operation == 'list':
        return str(keyword.kwlist)
    elif operation == 'check':
        return keyword.iskeyword(str(keywordtotest))