Getting Started with Python (2)

Source: Internet
Author: User

(1) Operators in Python

Any programming language has its operators, and Python's operators are similar to other languages.

Mathematics: +,-,*,, * * (exponentiation),%

Judgment: ==,!=,>,>=,<,<=,in

Logic: And,or,not

(2) Indentation and selection in Python

Python uses four spaces to indent an affiliation, and not to indent it arbitrarily.

(3) Loops in Python

For loop

For element in sequence:

Statement

Range

Create a table in which the elements of this table are integers, starting at 0, until the upper limit is written in the function.

Whlie Cycle

While condition:

Statement

Interrupt loop

Continue: Encounter continue, skip this execution, do the next operation

Break: Stop execution of the entire loop

Getting Started with Python (2)

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.