0 Basic python-4.5 Standard type classification

Source: Internet
Author: User

1. By storage: Atomic type and container type

Atomic type: Can contain only one object

Container type: can contain multiple objects

Classification Python type
Atomic type Numeric and string
Container type Lists, tuples, and dictionaries

2. Press to see if it can be changed: variable and immutable

Classification Python type
Immutable types values, tuples, and strings
Variable type List, dictionary
Here's what we need to illustrate: why values and strings are immutable, we illustrate by following an example:



From the above two images we can see, in fact, the value behind is simply a new object, re-assignment, so that the value and string is immutable

Then look at the tuple:


Although the value inside has changed, the entire tuple object has not changed, so the tuple is mutable.


3. Access by object slicing: direct access, sequential access, mapped access

Classification Python type
Direct access Numerical
Sequential access list, tuple, string
Map Access Dictionary

There are no more examples here, there are many concrete examples in the QuickStart.


Right here, thank you.

------------------------------------------------------------------

Click to jump 0 basic python-Catalogue





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

0 Basic python-4.5 Standard type classification

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.