spam = ['apple', 'banana', 'tofu', 'cats'] def lie(spam): for i in spam[:-1]: print(i, end=', ') print('and ' + spam[-1]) lie(spam) 4.10.1 逗号代码