0% found this document useful (0 votes)
84 views

Summary of Python 3's Built-In Types: Type Mutable Description Syntax Example

Python has several built-in types including bool, bytearray, bytes, complex, dict, float, frozenset, int, list, set, str, and tuple. Each type has a description, whether it is mutable or immutable, and syntax examples are provided.

Uploaded by

Asim Mahato
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views

Summary of Python 3's Built-In Types: Type Mutable Description Syntax Example

Python has several built-in types including bool, bytearray, bytes, complex, dict, float, frozenset, int, list, set, str, and tuple. Each type has a description, whether it is mutable or immutable, and syntax examples are provided.

Uploaded by

Asim Mahato
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Summary of Python 3's built-in types

Type mutable Description Syntax example


bool immutable Boolean value True
False
bytearray mutable Sequence of bytes bytearray(b'Some
ASCII')
bytearray(b"Some
ASCII")
bytearray([119, 105,
107, 105])
bytes immutable Sequence of bytes b'Some ASCII'
b"Some ASCII"
bytes([119, 105, 107,
105])
complex immutable Complex number with real and imaginary parts 3+2.7j

dict mutable Associative array (or dictionary) of key and value {'key1': 1.0, 3:
False}
pairs; can contain mixed types (keys and values),
keys must be a hashable type
ellipsis An ellipsis placeholder to be used as an index in ...

NumPy arrays
float immutable Floating point number, system-defined precision 3.1415927

frozenset immutable Unordered set, contains no duplicates; can contain frozenset([4.0,


'string', True])
mixed types, if hashable
int immutable Integer of unlimited magnitude[79] 42

list mutable List, can contain mixed types [4.0, 'string', True]

set mutable Unordered set, contains no duplicates; can contain {4.0, 'string', True}

mixed types, if hashable


str immutable A character string: sequence of Unicode codepoints 'Wikipedia'
"Wikipedia"
"""Spanning
multiple
lines"""
tuple immutable Can contain mixed types (4.0, 'string', True)

You might also like