A literal is a number or string that appears directly in a program. : variable « Introduction « Python Tutorial

Home
Python Tutorial
1.Introduction
2.Data Type
3.Statement
4.Operator
5.String
6.Tuple
7.List
8.Dictionary
9.Collections
10.Function
11.Class
12.File
13.Buildin Function
14.Buildin Module
15.Database
16.Regular Expressions
17.Thread
18.Tkinker
19.wxPython
20.XML
21.Network
22.CGI Web
23.Windows
Python Tutorial » Introduction » variable 




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














1.5.variable
1.5.1.A variable is basically a name that represents some value
1.5.2.Sequence Unpacking
1.5.3.A literal is a number or string that appears directly in a program.
1.5.4.Python is dynamically typed, no pre-declaration of a variable or its type is necessary.
1.5.5.Once a variable has been assigned, you can access it by using its name
1.5.6.None placeholder
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.