First, Python Introduction:
Python free, open source, object-oriented interpretation of the language, its syntax concise, in use without thinking about how to manage the underlying problems such as memory, and support in Linux,windows and other multi-platform operation, Python's standard library is very powerful, we just need to import it and call the methods therein, Can handle a variety of jobs, Python can also be embedded in the c\c++ program, Python is forced to indent the way the code is very readable, it is a reasonable combination of high performance and make programming simple and interesting features.
Python's main applications: Automated operations, automated testing, big data analytics, crawlers, web, and more.
The Python categories are divided into the following types:
Cpython: Compile with C, this is commonly used
Jyhton: Compiling python code into Java bytecode
IronPython: Python language implemented on net and mono
The Pypy:python implementation of Python, whose compilation execution process is the same as the C language's compilation execution (Python code-and machine code) executes faster, but is not mature enough to be used in production environments.
Second, comments and modules:
#: Single line comment
"" "" "" (or ""): Multiline Comment
Module Type:
Built-in modules, self-written modules, other modules written by others
Import module:
(1) Import module name
(2) From Module name Import method name
(3) Built-in function __import__ ()
SYS.ARGV Capture Parameters
Third, variable
Variable names are made up of letters, underscores, numbers, and numbers can be used as a starting point, and they can also have the same names as built-in keywords.
Memory consumption of variables:
1 " Zhangsan " 2 " Lisi "
1 " Zhangsan " 2 name2 = name1
Iv. user interaction, entering characters
Raw_input (python2.7)
Input (python3.x)
Getpass: Implicitly entering content
Cases:
1 Import Getpass 2 3 name = raw_input ("Pleaseinput username:")4 passwd = Getpass.getpass ("Please input passwd:")56 Print(name)7print(passwd)
V. Basic data types
1. Single value:
Digital
Integral type
Long integer type
Floating point Type
Plural
String:
‘‘
""
"" "" "" (or "" ")
Boolean value
true,1
false,0
2. Collection:
List
Meta-group
Dictionary
Collection (hash table)
Six, circulation
For
While
Python day1: first knowledge of Python