special-characters

make a string including x in python

make a string including x in python Question: I would like to make a string that includes “x” but I get invalid x escape error. a = ‘x’+”.join(lstDES[100][:2])+’x’+”.join(lstDES[100][2:]) How can I correct it? Asked By: user1914367 || Source Answers: Double the backslash to stop Python from interpreting it as a special character: ‘\x’ or use …

Total answers: 4