Text Type
Strings in Python are surrounded by either single quotation marks, or double quotation marks. Numeric Types
Integer is a whole number, positive or negative, without decimals, of unlimited length. Float is a number, positive or negative, containing one or more decimals. Complex numbers are written with a "j" as the imaginary part. Sequence Types
List items are ordered, changeable, and allow duplicate values. Tuple items are ordered, unchangeable, and allow duplicate values. Range( ) returns a sequence of numbers, starting from 0 by default. |
Mapping Type
Dictionary items are presented in key:value pairs. Dictionary items are ordered, changeable, and does not allow duplicates. Set Types
A set is a collection which is unordered, unchangeable, and unindexed. The frozen sets are the immutable form of the normal sets. Boolean Types
Booleans represent one of two values: True or False. Binary Types
Bytes and bytearray are used for manipulating binary data. The memoryview uses the buffer protocol to access the memory of other binary objects without needing to make a copy. |
Cheatography
https://cheatography.com
Built-in Data Types Cheat Sheet (DRAFT) by nuvixy
Built-in Data Types in Python
This is a draft cheat sheet. It is a work in progress and is not finished yet.