Skip to main content

escape sequences in Python 3.

 List of escape sequences available in Python 3.

Escape SequenceDescriptionExample
\newlineBackslash and newline ignored
print("line1 \
line2 \
line3")
RESULT
line1 line2 line3
\\Backslash (\)
print("\\")
RESULT
\
\'Single quote (')
print('\'')
RESULT
'
\"Double quote (")
print("\"")
RESULT
"
\aASCII Bell (BEL)
print("\a")
\bASCII Backspace (BS)
print("Hello \b World!")
RESULT
Hello  World!
\fASCII Formfeed (FF)
print("Hello \f World!")
RESULT
Hello 
 World!
\nASCII Linefeed (LF)
print("Hello \n World!")
RESULT
Hello 
 World!
\rASCII Carriage Return (CR)
print("Hello \r World!")
RESULT
Hello 
 World!
\tASCII Horizontal Tab (TAB)
print("Hello \t World!")
RESULT
Hello      World!
\vASCII Vertical Tab (VT)
print("Hello \v World!")
RESULT
Hello 
 World!
\oooCharacter with octal value ooo
print("\110\145\154\154\157\40\127\157\162\154\144\41")
RESULT
Hello World!
\xhhCharacter with hex value hh
print("\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21")
RESULT
Hello World!

Some escape sequences are only recognized in string literals. These are:

Escape SequenceDescription
\N{name}Character named name in the Unicode database
\uxxxxCharacter with 16-bit hex value xxxx. Exactly four hexadecimal digits are required.
\UxxxxxxxxCharacter with 32-bit hex value xxxxxxxx. Exactly eight hexadecimal digits are required.

Comments

Popular posts from this blog

Canva pro free 2022

  Hello dear friends if you get canva pro free for you Canva pro free if You get canva pro free click this link Paksoft Technology Please Subscribe My Channel Thanks

Canva pro free get

  How get Canva pro free for you. Dear friends if you get Canva pro free Subscribe my channel\ if you get Canva pro free Click this link Paksoft Technology

Python

Introduction to  Python Python is High Level Programming Language. Developed bh Guido Van Rossom in 1991 at Netherland Why Learn Python 1).Python in simple.Readable and Easy to Maintain 2).Python in Strong in Artificial Intelligence 3).Python in Dynamically Typed Language 4).Python in Interpreted with Shell 5).Multi Paradigm Support 6).Intergrated Language Popular Application developed in Python 1. Google(75%) 2.YouTube(AI) 3.Instagram 4.Netflix 5.Dropbox 6.Pinterest 7.Uber 10 Reason for learn Python 1).Python in simple and beginner friendly language 2).Length of the program in short 3).Huge numbers of Libraries to make life easy 4).web development using Python 5).Poratbility and extensibility 6).Graphical user interface 7).Web scrapping 8).Python in execllent for Enterprinse Application Integration(EAI) 9).Testing Framework 10).Automation Google Google has been a supporter of Python from nearly the very beginning. In the beginning, the founders of Google  made the decision ...