here's my code
spam = ['apples', 'bananas', 'lemons']
def funcc(spam):
for i in range(len(spam) - 1):
print(spam[i], ',')
print('and', spam[-1])
I need to make a function which returns a string with all the items separated by a comma and a space with 'and' inserted before the last item. But my function should be able to work with any list value passed on it. I don't need the full code to resolve my problem, just asking for techniques to solve this task!