I want a grammatically correct human-readable string representation of a list. For example, the list ['A', 2, None, 'B,B', 'C,C,C']
should return the string A, 2, None, B,B, and C,C,C
. This contrived example is somewhat necessary. Note that the Oxford comma is relevant for this question.
I tried ', '.join(seq)
but this doesn't produce the expected result for the aforementioned example.
Note the preexisting similar questions:
- How to print a list in Python "nicely" doesn't concern with a grammatically correct human-readable string.
- Grammatical List Join in Python is without the Oxford comma. The example and answers there are correspondingly different and they do not work for my question.