Created
June 12, 2019 21:12
-
-
Save paulhendricks/937f83df7a56a982496f1d982c6ef37e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spam = ['apple', 'banana', 'tofu', 'cats'] | |
result = ', '.join(spam[:-1]) + ', and ' + spam[-1] | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment