Python prints two backslash instead of one [duplicate]
问题 This question already has answers here : Difference between __str__ and __repr__? (22 answers) Closed 3 months ago . My goal is to print a backslash in Python3. My input is links22 = ['1',"n","nkf"] treee = ['<img src={} \>'.format(i) for i in links22] print(treee) The output that I get is: ['<img src=1 \\>', '<img src=n \\>', '<img src=nkf \\>'] And when I try: print("\\") The output is: \ I want to figure out why the first output is \ and in the second is . 回答1: The first \ is escaping the