Currently working my way through this beginners book and have completed one of the practice projects \'Comma Code\' which asks the user to construct a program which:
spam=['apples','bananas','tofu','cats']
print("'",end="")
def val(some_parameter):
for i in range(0,len(spam)):
if i!=(len(spam)-1):
print(spam[i]+', ',end="")
else:
print('and '+spam[-1]+"'")
val(spam)