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:
I'm new to python, there might be other easier solutions but here's mine
spam = ["cats","dogs","cows","apes"] def commaCode(list): list[-1] = "and " + list[-1] print(", ".join(list)) commaCode(spam)