"""
# Comma Code #
Say you have a list value like this:

```python3
spam = ['apples', 'bananas', 'tofu', 'cats']
```

Write a function that takes a list value as an argument and returns a string with all the items separated by a comma and a space, with _and_ inserted before the last item. For example, passing the previous spam list to the function would return 'apples, bananas, tofu, and cats' . But your function should be able to work with any list value passed to it.
"""


def commaCode(li):
    li[-1] = f"and {li[-1]}"
    return ", ".join(li)


spam = ['apples', 'bananas', 'tofu', 'cats']

print(commaCode(spam))
