I would like to know how to format this case in a Pythonic way with f-strings:
names = ['Adam', 'Bob', 'Cyril']
text = f"Winners are:\n{'\n'.join(names)}"
print(text)
The problem is that '\'
cannot be used inside the {...}
expression portions of an f-string.
Expected output:
Winners are:
Adam
Bob
Cyril