Python | Escape Characters

python escape character
python escape character

Escape  Characters

Escape character through you can add special character, To do this, simply add a backslash (\) before the character you want to escape.

in simple means , you can write a string in single or double string but suppose add  single quote inside another quote , in other words we want to get a string inside quote mark, to do fix this 

Example
        
        # without Quote mark
        a = ""john""        
        print(a)          # Return Syntax Error  
        
        #with Quote mark
        a = "\"john\""        
        print(a)               

Output

     "john"  


Also See
Post a Comment (0)
Previous Post Next Post