Загрузка...

What are the built-in data types in Python?

What are the built-in data types in Python?

Python offers numerous built-in data types that provide varying functionalities and utilities.

Immutable Data Types
1. int
Represents a whole number, such as 42 or -10.

2. float
Represents a decimal number, like 3.14 or -0.01.

3. complex
Comprises a real and an imaginary part, like 3 + 4j.

4. bool
Represents a boolean value, True or False.

5. str
A sequence of unicode characters enclosed within quotes.

6. tuple
An ordered collection of items, often heterogeneous, enclosed within parentheses.

7. frozenset
A set of unique, immutable objects, similar to sets, enclosed within curly braces.

8. bytes
Represents a group of 8-bit bytes, often used with binary data, enclosed within brackets.

9. bytearray
Resembles the 'bytes' type but allows mutable changes.

10. NoneType
Indicates the absence of a value.

Mutable Data Types
1. list
A versatile ordered collection that can contain different data types and offers dynamic sizing, enclosed within square brackets.

2. set
Represents a unique set of objects and is characterized by curly braces.

3. dict
A versatile key-value paired collection enclosed within braces.

4. memoryview
Points to the memory used by another object, aiding efficient viewing and manipulation of data.

5. array
Offers storage for a specified type of data, similar to lists but with dedicated built-in functionalities.

6. deque
A double-ended queue distinguished by optimized insertion and removal operations from both its ends.

7. object
The base object from which all classes inherit.

8. types.SimpleNamespace
Grants the capability to assign attributes to it.

9. types.ModuleType
Represents a module body containing attributes.

10. types.FunctionType
Defines a particular kind of function.
📚 Python | Beginner Friendly

🔗 Download Claryzo now! Link in bio

#python #programming #functions #javascript #education #learning #studytok #learnontiktok #claryzo #edutok

Видео What are the built-in data types in Python? канала claryzo
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять