Python Learning Note 1--python Introduction

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.