This is the Day 13 of the #90DaysOfDevOps challenge in which we had completed Linux, Git, and GitHub commands in brief. In today's blog, we are going to discuss Python and its datatypes that are important for DevOps Engineers for building logic and programs.
What is Python?
Python is an easy-to-learn programming language and it is most popular among all programming languages that are used in today's trending technologies like Machine Learning, Web Scraping, Data Science field, and Web Development. It was created by Guido Van Russom and released in 1991.
Python is a general-purpose high-level programming language that is used by most developers among other codes (C/C++, Java, etc) due to its simplicity. Python covers more complex problems in just a few lines of code rather than Java or in any other programming language. The recent version of Python is "Python 3".
We can use IDE (Pycharm, VS Code) to run python programs or in terminal.
Installation of Python:
https://www.python.org/downloads/ From here you can download Python. After installing python just verify by executing in the terminal or Command Prompt :
python --version
Python Data Types:
With the help of data types, we can categorize the data into different types.
Python has some built-in data types.
1) Numeric Data Types:
int - holds positive and negative whole number value that has no limit.
float - holds a decimal value that can be positive or negative numbers.
complex - It holds complex numbers means real part + imaginary part = 2+3ij
2) Sequence Data Types:
string - is a collection of one or more characters in single, double, or triple quotes. str is used for single characters.
list - It was like arrays, containing more than different types of words.
tuples - It works the same as a list but the difference between these two is that tuples are immutable means that cannot be modified after creation.
3) Boolean Data Types :
It is used for TRUE and FALSE means if they are right then it the decision will be TRUE or if the decision will be false then it will be FALSE.
4) Dictionary Data Type :
It is used for the collection of unordered datasets that hold in the KEY: VALUE pair. It is created by curly braces {} that are separated by a comma (,). In the dictionary, values can be duplicated but keys can't be.
So, this is the short and simple blog of Day 13 of the #90DaysOfDevOps challenge. We'll be discussing Data Types in more detail with examples.
Follow me on Hashnode and you can connect with me on Twitter !!
THANK YOU :)