0
How to add backslash
4 Answers
+ 16
You can add a backslash by writing two backslashes \\. You can put a backslash character followed by a quote (\" or \'). This is called an escape sequence and Python will remove the backslash, and put just the quote in the string. So to print a backslash we need to add two continuous backslashes \\
Example :
str1 = 'Solo'
str2 = 'Learn'
str3 = "Back\\Slash"
print(str1+str2) # normal printing without backslash
print(str1+"\\"+str2) # printing backslash
print(str3) # printing a string with backslash
+ 3
What do you mean by that?
It should be on your keyboard.
\
+ 1
thank you