Skip to content

Instantly share code, notes, and snippets.

@Gwith
Created August 7, 2016 20:48
Show Gist options
  • Save Gwith/ac0743002218ce882f78a64a213280b4 to your computer and use it in GitHub Desktop.
Save Gwith/ac0743002218ce882f78a64a213280b4 to your computer and use it in GitHub Desktop.
def comma(a_list):
last = a_list[-1]
all_but_last = a_list[0:-1]
new_all_but_last = ', '.join(all_but_last)
print(new_all_but_last + ', ' + 'and' + ' ' + last)
comma(spam)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment