Skip to main content
2 of 3
added 54 characters in body
Mike K
  • 111
  • 2

No loops, no joins, just two print statements:

def commalist(listname):
    print(*listname[:-1], sep = ', ',end=", "),
    print('and',listname[-1])

the end parameter in the first print will determine whether to use oxford comma.

Mike K
  • 111
  • 2