Python Learning Note-day1

Source: Internet
Author: User

Again code, record Python knowledge points, about Python variables, conditional judgment, loop statements

I. Classification of programming languages

1. Compiled language

After writing the code, compile the code into a binary file and run the compiled binaries when running. Like c/c++,c# and so on.

The feature is: run faster than fast, compile at once, run everywhere.

The disadvantage is that the compilation process is slow.

2. Explanatory language

Run a line of code to compile a line and when to run the code, such as: Php,python,ruby,java,go JavaScript, and so on. The Java language is also an explanatory language, and the. java file is compiled into a. class file, which is then executed by the JVM.

Disadvantage: Slow Running

3. Scripting language

A single language, called a scripting language. such as: Shell, bat, javascript,html,vb and so on.

Second, Python variables

1. Variable declaration

Python variables do not need to be declared in advance and are used directly, such as:

name = ' MyName '

Print (name)

You can assign a value that is declared.

2. Use of Python ', ', ', ' ', ' "'"

III. basic data types for Python

Iv. Conditions of Judgment

1, the conditional judgment statement is relatively simple, the following several:

If condition true:

EXECUTE Statement 1

Else

EXECUTE Statement 2

Example:

2, If-elif-else type

Extension: operator

> (greater than), < (less than), >= (greater than or equal), <= (less than equals),! = (not equal to), = = (equals)

If-elif-else Example:

V. Circulation

The loop repeats to do a thing. The Python loop has a for and while.

1. While loop

2. While-else Cycle

3. For loop

Six, string formatting

The code above is written using python3.6.4, Pycharm IDE, and executes successfully.

Python Learning Note-day1

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.