Python Programming basic data types
None value
Integral type
Floating point Type
Boolean type
True,false
String
Tuple tuples
(), ordered, not variable
Cases:
t = (1,)
t = (1, ' Hello ', 1.0,true)
Lists List
[], ordered, variable
Cases:
L = [1, ' Hello ', 1.0,true]
Dictionary Dict
{}, key-value pairs, unordered
Cases:
D = {: ' A ', 48:0, ' a ': $, ' Hello ': ' World '}
Operator Math operator
+
-
*
/except
Divisible
% modulus
* * Index
Comparison operators
Boolean operator
Variable scope
Comment Line Comment
# single Comment
Multi-line comments
"' Multiple lines
Note ""
Special Notes
#!python3
Must be the first line of the file and must be #! Beginning
Control flow Condition Branch
If statement
Else statement
elif statements
Cycle
Exception handling
Try
Except XXX:
Else
function function definition
def statement
Return statement
Common functions
This article is from the "Learning" blog, so be sure to keep this source http://learnwithme.blog.51cto.com/7148047/1895594
Basics of Python programming