Fix Python – How to use newline ‘\n’ in f-string to format output in Python 3.6?

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

….

Fix Python – CSV in Python adding an extra carriage return, on Windows

import csv

with open(‘test.csv’, ‘w’) as outfile:
writer = csv.writer(outfile, delimiter=’,’, quoting=csv.QUOTE_MINIMAL)
writer.writerow([‘hi’, ‘dude’])
writer.writerow([‘hi2’, ‘dude2’])

The above code generates a file, test.csv, with an extra \r at each row, like so:
hi,dude\r\r\nhi2,dude2\r\r\n

instead of the expected
hi,dude\r\nh….