Hive-blogger avatar

Primitive and non-primitive data structures in Python

alrashel

Published: 30 May 2020 › Updated: 30 May 2020Primitive and non-primitive data structures in Python

Primitive and non-primitive data structures in Python

Note : This tutorial only deals with the concept of data structure, I will discuss the next tutorial in detail.

code-1084923_1280.png

Source

Primitive data structures :

Primitive data structures are the basic ingredients in the Python programming language. These are predefined for storing data and the set of actions on these data structures are also predefined. It contains simple values of data.

Primitive data types in Python are as follows :

Strings :

Strings are words or letters. It means string represents a group of alphabetic words or character which are quoted by single or double quotations. For example - 'python', "python" etc.

Integers :

The integer represents numeric value without decimals. It is any whole number, positive or negative, like 10,21,-100.

Floats :

Float or floating-point number represents numeric values ending with a decimal point. Such as 1.29, or 0.123.

Boolean :

It represents only two values: True or False

data_types.jpg

Non-primitive data structure:

These data are sophisticated and derived from the primitive data structures. Used for grouping of homogeneous (same kind) or heterogeneous (a different kind) data items.

Python has generally some built-in Non-primitive data structures, which can be divided into the following categories :

1. Sequence Type: list, tuple, range
2. Set Types: set, frozenset
3. Mapping Type: dict

......................................................................................

Leave Primitive and non-primitive data structures in Python to:

Written by

Passionate software developer and interests in Travelling, Blogging, Photography and active lifestyle.

Read more #education posts


Best Posts From Hive-blogger

We have not curated any of alrashel's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Hive-blogger