Day 14 of #90DaysOfDevOps

Basavaraj TeliBasavaraj Teli
2 min read

Data types in Python

Data types are the classification or categorization of data items. It represents the kind of value that tells what operations can be performed on a particular data.

Python has the following data types built-in by default, in these categories:

Text Type:str
Numeric Types:int, float, complex
Sequence Types:list, tuple, range
Mapping Type:dict
Set Types:set, frozenset
Boolean Type:bool
Binary Types:bytes, bytearray, memoryview
None Type:NoneType

Data Structures

Data Structures are a way of organizing data so that it can be accessed more efficiently depending upon the situation. Data Structures are fundamentals of any programming language around which a program is built. Python helps to learn the fundamental of these data structures in a simpler way as compared to other programming languages.

  • Lists: Python Lists are just like the arrays, declared in other languages which is an ordered collection of data. It is very flexible as the items in a list do not need to be of the same type

  • Tuple: Python Tuple is a collection of Python objects much like a list but Tuples are immutable in nature i.e. the elements in the tuple cannot be added or removed once created. Just like a List, a Tuple can also contain elements of various types.

  • Dictionary: Python dictionary is like hash tables in any other language with the time complexity of O(1). It is an unordered collection of data values, used to store data values like a map, which, unlike other Data Types that hold only a single value as an element, Dictionary holds the key:value pair. Key-value is provided in the dictionary to make it more optimized.

    Create below Dictionary and use Dictionary methods to print your favourite tool just by using the keys of the Dictionary.

    Create a List of cloud service providers eg.

    cloud_providers = ["AWS","GCP","Azure"]

0
Subscribe to my newsletter

Read articles from Basavaraj Teli directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Basavaraj Teli
Basavaraj Teli

Aspiring DevOps engineer, working on DevOps projects to gain practical knowledge. I write technical blog post on DevOps to share my knowledge with fellow tech enthusiasts.