Skip to main content
update formatting
Source Link

NoThis can be achieved with no loops, and no joins, just two printprint statements:

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

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

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.

This can be achieved with no loops and 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.

added 54 characters in body
Source Link
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 fisfirst print will determine whether to use oxford comma.

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 fis

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.

Source Link
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 fis