def get_comma_sep_string_from_list(items):

    if not items:
        return ''

    if len(items) == 1:
        return items[0]

    return '%s and %s' % (', '.join(items[:-1]), items[-1])
Turns a list of items into a comma-separated string.
dataset/ETHPy150Open oppia/oppia/utils.py/get_comma_sep_string_from_list