A literal is a number or string that appears directly in a program. : Variable : Introduction PYTHON TUTORIALS


PYTHON TUTORIALS » Introduction » Variable »

 

A literal is a number or string that appears directly in a program.


The following are all literals in Python:
42                       # Integer literal
3.14                     # Floating-point literal
1.0j                     # Imaginary literal
'hello'                  # String literal
"world"                  # Another string literal
"""Good night"""                 # Triple-quoted string literal

Using literals and delimiters, you can create data values of some other fundamental types:
423.14'hello' ]    # List
100200300 )        # Tuple
'x':42'y':3.14 }     # Dictionary



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Introduction
» Variable