Python Concise-2 (only to list the differences in other languages)

Source: Internet
Author: User

Module

The module is a file containing all of your defined variables and functions, added multiplexing, and the module file must be suffixed with the PY

When we import the module using import, for example, the import sys will be in the Sys. The path of the py is searched for this module

The form SYS Import * Imports all the variable names in SYS and does not recommend

Each module has its own __name__, when __name__ equals __main__, indicating that the module is executed separately

Dir () enumerates all the function classes and variables

Enrich Module Knowledge Later

Data

[1:3] The second element to the fourth element # is calculated from 0, the index if it is negative from the back forward called a part of the sequence

[:] Returns a copy of the sequence!

list, tuple, dictionary ["A", "B", "C"]

List lists are similar to arrays

Tuples are similar to lists, but the values cannot be changed! ("A", "B", "C")

Dictionaries are similar to JSON, that is, key-value pairs

Reference

Direct replication does not create a copy if you want to copy it must be [:]

Methods for string Classes

Cond....

  

Python Concise-2 (only to list the differences in other languages)

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.