Python Literals

Python language has various aspects which one should consider while using this language. If this is used in the right way then one can get the best results. The language has been accepted worldwide because of the simplicity it provides while programming.

There are the python literals which can be used for the variables.

The literals in python programming language are defined as the data which is provided in the variable or the constant. There are various types of literals which are supported by Python programming language - here are some of them

String literal is the first type of literal which is used in the python programming. These string literals are easily formed using the text which is enclosed in the text of the coding.

In case of string literals you can also use single or double quotes as per your requirement. There are two types of string literals which supports the programming language.

Namely single line string - these are the ones which are terminated in a single line. Next is the multi-line string - in this piece of text the multiple strings are used for multiple lines. You can create the multiline strings with the help of using the back slash at the end of every line.

Python support the following literals.

  • String literals
  • Numeric literals
  • Boolean literals
  • Special literals
  • Literal Collections