Python-based data types

Source: Internet
Author: User

Python 's core data types:

Number -

Int: Shaping

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/70/EC/wKiom1XBeL2gUquaAABE-1Lcauk769.jpg "title=" 1.png " alt= "Wkiom1xbel2guquaaabe-1lcauk769.jpg"/>

Long: Plastic

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/EC/wKiom1XBeQaQlwnuAABP-39VYNk320.jpg "title=" 1.png " alt= "Wkiom1xbeqaqlwnuaabp-39vynk320.jpg"/>

Float: Float type

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/EC/wKiom1XBeUfSh3d4AABKmua0krI211.jpg "title=" 1.png " alt= "Wkiom1xbeufsh3d4aabkmua0kri211.jpg"/>

Complex: Negative

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/EC/wKiom1XBeEyRO3P3AABOpKqpV9U821.jpg "title=" 1.png " alt= "Wkiom1xbeeyro3p3aabopkqpv9u821.jpg"/>

BOOL: Boolean type

A Boolean type has only two values, False and True.

It is often used to determine whether conditions are true.

If the value of the variable is 0 is False, otherwise true, the Boolean type has only these two values.

characters : str: Character type , String or strings (string) is a string of characters consisting of numbers, letters, and underscores , mainly in single-quote ' or double-quote notation, where single and double quotes do not differ

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/70/EC/wKiom1XBelyR3mu2AABNk43pl0E124.jpg "title=" 1.png " alt= "Wkiom1xbelyr3mu2aabnk43pl0e124.jpg"/>


List: list, used more frequently, lists can accomplish the data structure implementation of most collection classes. It supports characters, numbers, strings can even include a list (so-called nesting), the list of worthy division can also be used in the variable [head subscript: Tail subscript], you can intercept the corresponding list, from left to right index default 0 start, right-to-left index default-1, subscript can be empty to take the head or tail.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/EC/wKiom1XBfA7T0bsYAABd4kfpmZI708.jpg "title=" 1.png " alt= "Wkiom1xbfa7t0bsyaabd4kfpmzi708.jpg"/>


Tuple :tuple, tuple is another data type, similar to list, tuple is identified by "()". The inner elements are separated by commas. However, an element cannot be assigned two times, which is equivalent to a read-only list.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/E9/wKioL1XBgZrDbn9tAACbuXcmlwI991.jpg "title=" 1.png " alt= "Wkiol1xbgzrdbn9taacbuxcmlwi991.jpg"/>


Dictionary:dict( shorthand for dictionary), the Dictionary (dictionary) is the most flexible built-in data structure type in Python except for lists. A list is an ordered combination of objects, a dictionary is a collection of unordered objects, the difference between the two is that the elements in the dictionary are accessed by keys rather than by offset access, and the dictionary is identified with "{}". A dictionary consists of an index (key) and a value corresponding to it.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/70/EC/wKiom1XBfP2C3tcfAABdAlyhTT0462.jpg "title=" 1.png " alt= "Wkiom1xbfp2c3tcfaabdalyhtt0462.jpg"/>


Files: File


This article is from the "Linux" blog, so be sure to keep this source http://zhangshijie.blog.51cto.com/806066/1681824

Python-based data types

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.