What is Escape Sequence in Python | EP-23 Escape Sequence in Python | Escape Characters in Python
Escape Sequences in Python
"""
While printing Strings with single and double quotes in it causes SyntaxError because
String already contains Single and Double Quotes and hence cannot be printed with the
use of either of these. Hence, to print such a String either Triple Quotes are used or
Escape sequences are used to print Strings.
Escape sequences start with a backslash and can be interpreted differently.
If single quotes are used to represent a string, then all the single quotes present in
the string must be escaped and the same is done for Double Quotes."""
company = """i'm "cybrosys" """
print("Initial string with the use of triple quotes:")
print(company)
Escaping Single Quote
company = 'I\'m "cybrosys"'
print("Escaping Single Quotes:")
print(company)
Escaping Double Quotes
company = "I'm a \"cybrosys\""
print("Escaping Double Quotes:")
print(company)
Printing Paths with the
use of Escape Sequences
company = "C:\\Python\\cybrosys\\"
print("\nEscaping Backslashes: ")
print(company)
#PythonProgramming #EscapeSequences #LearnPython #PythonTutorial #CodingTips #ProgrammingBasics #PythonForBeginners #PythonCode #TechEducation #CodingTutorials #python #programming #tutorial #escapesequence #pythonprogramming #pythontips #codingtutorial #learntocode #python3 #pythondeveloper
Connect With Us:
—————————————
➡️ Website: https://www.cybrosys.com/
➡️ Email: info@cybrosys.com
➡️ Twitter: / cybrosys
➡️ LinkedIn: / cybrosys
➡️ Facebook: / cybrosystechnologies
➡️ Instagram: / cybrosystech
➡️ Pinterest: / cybrosys
Other Videos By Cybrosys Technologies
Other Statistics
Escape Sequence Statistics For Cybrosys Technologies
Cybrosys Technologies currently has 93 views spread across 1 video for Escape Sequence. Less than an hour worth of Escape Sequence videos were uploaded to his channel, making up less than 0.02% of the total overall content on Cybrosys Technologies's YouTube channel.