Python Learning note _day1_ initial python

Source: Internet
Author: User

1. Python is a dynamic, interpretative, mandatory definition language.

Compiled type Source code for conversion (compiler), such as: C + +, VB and so on.
Explanatory type Read an explanation, for example: Java, JS, Vbscipt, Perl, Python, etc.

Note: With the development of design technology and hardware, the boundary between the two ways of compiling and interpreting is becoming blurred.

Dynamic language Data type checking is done during runtime, for example: Python, etc.
Static language The data type of all variables to be life when writing a program, for example: C #, Java, etc.

Strongly typed definition language Enforces the language of the data type definition. (Forced type conversion)
Weak type definition language A variable can give values of different data types.

2. The advantages and disadvantages of the Python language:

Excellent: Easy to get started, high development efficiency (third-party library Rich), advanced language, portability, extensibility, embeddable

Missing: Slow running, code cannot be encrypted, threads cannot take advantage of multi-CPU issues

3. Python forces indentation.

python Installation: Download the installation package-"Configure Environment Variables-" Download IDE tools,

First Python program: HelloWorld

4. Character encoding and annotation

ASCII-GB2312-Unicode (Utf-8)

Single-line Comment: # commented content

Multi-line Comment: ' Annotated content '

The default character encoding in Python3 is utf-8.

5. Variable store information to be refereced and maniplated

When assigning a value to a name, it is stored in memory, which becomes a variable (variable).

Variable name naming rules:

    • Keywords cannot be declared as variable names [' and ', ' as ', ' assert ', ' Break ', ' class ', ' Continue ', ' Def ', ' del ', ' elif ', ' Else ', ' except ', ' exec ', ' finally ' ' For ', ' from ', ' global ', ' if ', ' import ', ' in ', ' was ', ' lambda ', ' not ', ' or ', ' pass ', ' print ', ' raise ', ' return ', ' Try ', ' While ', ' with ', ' yield ']
    • The first character of a variable name cannot be a number
    • Variable names can only be any combination of letters, numbers, or underscores
    • Variable names differ case
    • Variable name try to take a professional name

Assignment of variables:

Note: The general constant variable name should be capitalized (indicating that it should not be changed)

user input:input () in Python, all input defaults to a string type and requires casting.

algorithm: A detailed description of doing something. (Commands executed sequentially: Direct completion, specific conditions, number of repetitions)

statement: An instruction that tells the computer to do something.

functions: functions in the same mathematics.

modules: extensions to Python functionality that can be imported into Python.

Python Learning note _day1_ initial python

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.