Python Learning Note "1" Introduction, basic grammar, Process Control

Source: Internet
Author: User

First, Python introductionthe founder of Python is Guido van Rossum (Guido van Rossum). Python's main application areas: Web Development, data analysis, network programming, cloud computing, system operation and maintenance .

Programming languages are mainly categorized from the following angles: compiled and interpreted, static and dynamic, strongly typed, and weakly typed.

  Dynamic language and static language

  (1) Dynamic type language: Dynamic type language refers to the language of data type checking during run time, that is, when programming in a dynamic type language, you never have to specify a data type for any variable, and the language will record the data type internally when you assign it to a variable for the first time. Python is a typical dynamic type language.

(2) Static type language: The static type language is just the opposite of the dynamic type language, its data type is checked during compilation, that is, the data type of all variables is declared when the program is written, and C + + is a typical representative of the static type language.

Strongly typed definition language and weak type definition language

  (1) Strongly typed definition language: A language that enforces the definition of a data type. In other words, once a variable is assigned a data type, it is always the data type if it is not cast. For example: If you define an integer variable A, the program simply cannot treat a as a string type. A strongly typed definition language is a type-safe language.

(2) Weakly typed definition language: a language in which data types can be ignored. In contrast to strongly typed definition languages, a variable can assign values of different data types.

Strongly typed definition language may be slightly slower than weak type definition language, but the rigor of strong type definition language can effectively avoid many errors. In addition, "The language is not a dynamic language" and "the language is the type of security" is completely no connection between!
For example: Python is a dynamic language and is a strongly typed definition language (type-safe language);; Java is a static language and is a strongly typed definition language (type-safe language).

Python is a dynamically explanatory, strongly typed definition language.

  Advantages

    1. Python's positioning is "elegant", "clear", "simple".
    2. Python has a very powerful third-party library, which is highly efficient to develop.
    3. High-level language.
    4. Portability.
    5. Scalability.
    6. can be embedded.

  Disadvantages

    1. Slow speed.
    2. The code cannot be encrypted, because Python is an explanatory language, and its source codes are stored in the form of a famous text.
    3. Threads cannot take advantage of multi-CPU issues.
Python interpreter

CPython the official version of the interpreter.    This interpreter was developed in C language, so called CPython.

PyPy uses JIT technology to dynamically compile Python code (note that it is not interpreted), so it can significantly improve the execution speed of Python code.

  Specified interpreter under Linux

#!/usr/bin/env python

Python Learning Note "1" Introduction, basic grammar, Process Control

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.