Python translation Chinese is python. Inventor Guido like the Python circus, so he named Python.
A brief history of Python development:
--cnri period. Cnri funded the development of Python important units, the python1.5 version of the results before the majority of the completion of this period.
--beopen period. python1.6 and python2.0 are also available, in principle maintained separately.
--DC period.
--python3.0
Python Features:
--Scripting language
--Advanced dynamic programming language
Easy and easy to learn. Explanatory & compiler. Object-oriented programming. High-level language. Scalability and embedding. Free Open source. Portable. A rich library.
Python applications:
Building a Python environment:
1. Linux Environment
2.windows environment.
Python is executed in two ways: 1. Interactive mode, 2 script file.
Python file type:
Source code: Typically a file named. py.
BYTE code: The source file is compiled with the file name extension PYc.
Compile by: Import Py_compile
Py_compile.compile ("hello.py")
Optimized code:
An optimized source file with the. pyo extension.
Python-o-M Py_compile hello.py
All three types of files can be executed directly.
Variable: An area of computer memory. Variables can store values within a specified range, and variable values can be changed.
Name of variable names:
--variable names are made up of numbers, letters, and underscores.
--numbers cannot begin.
--Not used keyword
The assignment of the variable.
Python's handling of variables in memory is a change to the variable name A, where the data in memory is unchanged, but the memory address value of a point is changed.
-----------------------------
Operators and expressions
Operators: arithmetic, relationships, assignments, logical operators.
An expression is an expression that connects different data operators to certain rules.
Arithmetic: +,-, *,/,//(divisible),%,** (Power operation)
Relationship: <,> <=, >=,! =, = =
Logic: And, OR, not
Operator Precedence:
------------------------------------------------
Data type:
Numbers, strings, tuples, lists, dictionaries
Number: integer, Long Integer, floating point, plural (real + imaginary j, e.g. 4+3j).
Strings: single quotes, double quotes, three quotation marks.
Sequence type: string, tuple, list
The index operation and the slice operation of the sequence. Slices with head to tail.
Python Learning Note 1--python Introduction