1 2 3 4 5 6 7 8 9 10 11 12 13 14
# !Python # Chapter 4 practice projects def eggs(listvalue): for i in range(len(listvalue)): print(listvalue[i] + ', ', end="") if listvalue[i] == listvalue[-2]: print('and ' + listvalue[-1], end="") break spam = ['apples','bananas','tofu','cats'] eggs(spam)