From the book: Automate the Boring Stuff With Python. Writer: AL Sweigart
It is a practice project for python beginners.
Say you have a list value like this:
spam = ['apples', 'bananas', 'tofu', 'cats']
👉 No.1 Write a function that takes a list value is 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.