A literal is nothing but a constant value that is stored into a variable in a Python program. For instance, in a = 10, a is variable name and 10 is a literal. Literals are divided into following parts :
- Numeric Literals
- Boolean Literals
- String Literals
Numeric Literals may involve integer literal, float, hexadecimal, octal, binary, complex literal etc. Hexadecimal starts from 0x or 0X. Octal literal starts from 0o or 0O. Binary literal starts from 0b or 0B.
Boolean Literals involve only two values : True or False
String Literals represents the group of characters.
Escape Sequence : Escape Sequence are the special characters that provides special meaning to the Python interpreter.
|\||New line Continuation|
|\\||Display a single \|
|\’||Display a single quote|
|\”||Display a double quote|
|\t||Horizontal Tab space|