The composition of the Python program

Source: Internet
Author: User

The composition of the Python program

1. The Python program is composed of modules. One, module corresponding to Pythom source file, general suffix Teacher:. py

2. The module is composed of statements. Running the Python program is done in the order of the statements in the module

3, the statement is the Python program's constituent unit, is used to create the object, the variable assignment call function and so on.

Creation of Python files execution

Interactive mode, only one statement can be executed at a time. Writing multiple statements to implement complex logic requires creating a Python file in which to execute the file.

In the idle environment, create a new Python file with File-->new.

Indentation of code

Indentation is a mandatory syntax specification for the Python language. Indents are usually represented by four spaces.

Comments

Previously mentioned, no Duplicate records

Line connector

There is no limit to the length of code per line, but for greater readability, a long line of code is divided into lines, using \ Connection

>>> a = [10,20,30,40,\
50,60,70,\
80,90,100]
>>> A
[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]

The composition of the Python program

Related Article

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.