TOPIC: Python Strings - Strings Method
Python string
Python string is a sequence of unicode characters that is enclosed in the quotation marks. It is on
immutable data type, meaning that once you have created a string, it cannot be changed. Strings are
used widely, in mainly different applications such as sorting and manipulating text data,
representing names, addresses and other types of data that can be presented as text.
Python does not have a character data type; a single character is simply a string with a length of 1
sequence brackets can be used to access elements of the strings.
Sl No. | Uses |
---|---|
\n | Represents a newline character. |
\t | Represents a tab character. |
\ | Represents a backslash character. |
' | Represents a single quotation mark (apostrophe). |
" | Represents a double quotation mark. |
\x | Represents a character using its hexadecimal ASCII value. |
Code as discussed in the video:
You can copy and run this code