Skip to content
Advertisement

Printing wrong text in list in Python

This is My Code.

JavaScript

When I am trying to add backslash in the list of strings with the following code. list = ['\' + item for item in res] This Will remove + From the list and add ‘\’ in the starting of the code. I am also tried with r'\' But this is not worked for me. Please Help me to Solvee this. Here is What I got.

JavaScript

Here What is Expected .

JavaScript

Thanks For Your Help in Advance ! ❤️

Advertisement

Answer

Your code is as i should be:

JavaScript

Outputs:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement