First, the opening output: print ("Hello world!")
Second, Chinese free line: #coding =utf-8 or #--Coding:utf-8--
Three, Linux multi-line: #!/usr/bin/python
Four, not a few comments:
1. #单行注释
2. "Multi-line Comment"
Identifiers consist of letters, underscores, numbers, and numbers cannot begin
Vi. keywords that cannot be modified or used
Import keyword
Keyword.kwlist
VII. Naming conventions:
1, see the name of the idea
2, Hump name law
Viii. Formatting of strings:
1. "My name is%s, this year%d years old"% (name, age))
2, "My name {0}, this year {1} years old". Format (Name,age)
Nine, Input: input () receives the expression input, and assigns the result of the expression to the variable to the left of the equal sign
Name = input ("Please enter Name:")
age = Int (input ("Please enter Ages:"))
Ten, Operator:
1, arithmetic operators: + 、-、 *,/,//,%, *
2. Assignment Operator: =
3. Compound assignment operator: +=,-=, =,/=,//=,%=, **=
Xi. Common data type conversions
int (x [, Base]), Long (x [, Base]), float (x), complex (real [, imag]), str (x), repr (x), eval (str), tuple (s), list (s), Chr (x), UN ICHR (x), Ord (x), Hex (x), Oct (x)
12, the Judgment statement introduction: IF
If certain conditions are met, it is not permissible to do something without being satisfied. Daily, such as railway station security.
13. Comparison, relational operators
1, comparison (that is, the relationship) operator: = =,! =, <>, >, <, >=, <=
2. Logical operator: and OR not
Python Small white Road (basic knowledge One)