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(
You don't need f-strings or other formatters to print a list of strings with a separator. Just use the sep keyword argument to print():
names = ['Adam', 'Bob', 'Cyril']
print('Winners are:', *names, sep='\n')
Output:
Winners are:
Adam
Bob
Cyril
That said, using str.join()/str.format() here would arguably be simpler and more readable than any f-string workaround:
print('\n'.join(['Winners are:', *names]))
print('Winners are:\n{}'.format('\n'.join(names)))