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

Python Data Types

Python supports several built-in data types including numeric types (int, float, complex), sequence types (str, list, tuple), mapping type (dict), set types (set, frozenset), boolean type (bool), and None type. These data types allow for the storage and manipulation of various kinds of data. Python is dynamically typed, meaning variable types are inferred from assigned values.

Uploaded by

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

Python Data Types

Python supports several built-in data types including numeric types (int, float, complex), sequence types (str, list, tuple), mapping type (dict), set types (set, frozenset), boolean type (bool), and None type. These data types allow for the storage and manipulation of various kinds of data. Python is dynamically typed, meaning variable types are inferred from assigned values.

Uploaded by

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

Data Types in Python

Python supports several built-in data types. Here's an overview of some of the most
commonly used data types in Python:

1. Numeric Types:
 int: Integer numbers, e.g., 5, -3, 1000.
 float: Floating-point numbers, e.g., 3.14, -0.001, 2.0.
 complex: Complex numbers, e.g., 2 + 3j, -1 - 2j.
2. Sequence Types:
 str: String, a sequence of characters, e.g., "hello", 'world'.
 list: Ordered collection of items, mutable, e.g., [1, 2, 3], ['a', 'b', 'c'].
 tuple: Ordered collection of items, immutable, e.g., (1, 2, 3), ('a', 'b', 'c').
3. Mapping Type:
 dict: Collection of key-value pairs, e.g., {'name': 'John', 'age': 30}.
4. Set Types:
 set: Unordered collection of unique items, mutable, e.g., {1, 2, 3}.
 frozenset: Unordered collection of unique items, immutable, e.g.,
frozenset({1, 2, 3}).
5. Boolean Type:
 bool: Represents Boolean values True and False.
6. None Type:
 None: Represents the absence of a value or a null value.

These data types can be used to store different kinds of data and perform various
operations on them. Python is dynamically typed, meaning you don't need to
explicitly declare the data type of a variable; it's inferred based on the value assigned
to it.

You might also like