Skip to main content

Command Palette

Search for a command to run...

Day 15 Task: Basics of Python for DevOps Engineers

Updated
4 min read
Day 15 Task:  Basics of Python for DevOps Engineers
R

Hi, I’m Rakshita. A Cloud, DevOps, AI, and Python enthusiast passionate about learning and simplifying technology for others. I love exploring how modern tools and automation can make systems smarter and more efficient. Here, I write about: ☁️ Cloud & DevOps practices 🤖 AI in the world of automation 🐍 Python for real-world problem-solving 💡 Growth, consistency, and the learner’s mindset My goal is to bridge the gap between learning and doing, and help others grow confidently in the evolving tech landscape.

What is Python?

Python is an open-source, general-purpose, high-level, and object-oriented programming language. It was created by Guido van Rossum. Python is commonly used for developing websites and software, task automation, data analysis, and data visualisation. Its versatility and its beginner-friendliness have made it one of the most used programming languages today.

Python consists of vast libraries and various frameworks

Framework in Python:

A framework is like a structure that provides a base for the application development process. With the help of framework you can aviod writing everything from scratch. Frameworks are based on programming languages.

Types of framework

  1. Full-Stack Framework: A full-stack framework contains all the web development requirements.

  2. Micro Framework: Micro frameworks require a bit of manual work from developers.

  3. Asynchronous Framework: Asynchronous frameworks used to run a number of processes concurrently. They can handle a large number of concurrent connections.

Some of the examples of framework in Python are:

  • Django- Django is a full-stack Python framework. It is a most famous and beloved framework for developing rich web applications.

  • Flask- Flask is a popular Python micro-framework. It is lightweight and has a modular design. Using the Flask, developers can build a solid web application foundation.

Libraries in Python:

A library is a collection of precompiled codes that can be used later on in a program for some specific well-defined operations. It makes Python Programming simpler and convenient for the programmer. As we don’t need to write the same code again and again for different programs. Python libraries play a very vital role in fields of Machine Learning, Data Science, Data Visualization, etc.

Some of the examples of libraries in Python are:

  • TensorFlow: TensorFlow is a fast, open-source library for numerical calculations. It is utilized by ML and deep learning algorithms as well.

  • Pandas: Pandas is an open-source library, utilized in the field of data science. They're generally utilized for examination, control, and cleaning of information, in addition to other things.

  • Keras: Keras emerges as a viable option as deep learning becomes more common because, according to its developers, it is an API (Application Programming Interface) designed for humans rather than machines.

How to Install Python?

We can install Python on our system, whether it is Windows, macOS, Ubuntu, CentOS, etc. Here’s how we can install it on each OS:

  1. Windows Installation:

    Go to python website Windows Installation and download the latest python version for windows.

    Click on install now, also check the box that says “Use admin privileges when installing pi.exe“ and “Add python.exe to PATH“. You will see:

    And your python has successfully installed.

    To verify and check your python version open your command prompt (cmd) and run:

python --version

  1. Mac OS Installation:

    Go to python website https://www.python.org/downloads/macos/ and download the package.

    To verify and check the python version. Open your terminal and run:

python3 --version
  1. Ubuntu Installation:

    To install python on Ubuntu, open your terminal and run:

sudo apt-get install python3

To verify and check the python version, run:

python3 --version
  1. CentOS Installation:

    To install python on CentOS, open your terminal and run:

sudo apt-get install python3

To verify and check the python version, run:

python3 --version

Data Types in Python

Python supports the following built-in data types −

  1. Numeric Data Types:

    Integer (int)*:* Integer values (e.g: 2, -5)

    Float (float): Floating-point numbers or decimals (e.g: 2.11, -5.34)

    Complex (complex): Complex numbers (e.g: 3+5i)

  2. Sequence Types:

    String (str): Strings, a sequence of characters (e.g: “Hello, World“)

    List (list): Ordered, mutable sequence (e.g: [1, 2, 3] )

    Tuple (tuple): Ordered, immutable sequence (e.g: (1, 2, 3) )

  3. Set Types:

    Set (set): Unordered collection of unique elements (e.g., {1, 2, 3} )

    Frozenset (frozenset): Immutable version of a set.

  4. Boolean Type:

    Bool (bool): Represents True or False.

  5. Mapping Type:

    Dictionary (dict): Key-value pairs (e.g: {“name“: “Rakshita“, “age“: 24} )

  6. None Type:

    None: Represents the absence of a value.

Conclusion

Python is an ideal language for beginners and professionals alike, empowering developers to build robust applications quickly and efficiently with its vast libraries and frameworks. Python helps in writing efficient code to automate the task. It helps every DevOps engineer to work efficiently that can simply many tasks.

HAPPY LEARNING!🌟

More from this blog

L

Learning Made Simple - RealTimeHandson

25 posts