Sep-04-2019, 12:38 AM
from random import choice as rc string = f"never say you {rc(['can', 'can\'t'])} do something" print(string)
Output:File "C:/Users/Exsul/.PyCharmCE2019.2/config/scratches/scratch.py", line 3
string = f"never say you {rc(['can', 'can\'t'])}"
^
SyntaxError: f-string expression part cannot include a backslash
Process finished with exit code 1
How can I put an apostrophe inside the curly brackets, since I can't escape an end quotation mark with \
?