You are looking for:
"\n".join(["{0}. {1}".format(i+1, person) for i, person in enumerate(defaultersList)])
Of course, the "\n"
token will be in the string, but if you call print
, you'll see a multiline string.
"\n"
is how a newline is represented in Python (and computers in general).