Day-13 Python

Let's Start with the Basics of Python as this is also important for DevOps engineers to build the logic and Programs. Python is one of the primary technologies used by professionals and teams practicing DevOps. Python provides the flexibility and accessibility needed in this process, making it an excellent choice for DevOps tasks. It enables DevOps professionals to build, test, deploy, visualize and monitor the DevOps lifecycle with improved, simple, but sophisticated custom utilities.

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 consists of vast libraries and various frameworks like Django, Tensorflow, Flask, Pandas, Keras etc.

How to Install Python?

You can install Python in your System whether it is Windows, MacOS, ubuntu, centos etc. Below are the links for the installation:

  • Ubuntu: apt-get install python3.6

Task1:

  1. Install Python in your respective OS, and check the version.

  2. Read about different Data Types in Python.

    1. Numbers: Python supports integers, floating point numbers and complex numbers. They are defined as int, float and complex classes in Python.

      Int: whole numbers that can be positive or negative with no decimal point example: 1,2,-1,-100.

      Float: real numbers that are written with a decimal point example: 2.15, 3.14.

      Complex: complex is in the form a+bj where a and b are float. example: 3.14j, 45j.

    2. Strings: Strings in Python are arrays of bytes representing Unicode characters. example: "Hello world", "Name".

    3. Lists: A list is a special datatype in Python that is mutable or changeable, an ordered sequence of elements. Each element or value that is inside of a list is called an item.

      It is denoted by square brackets [].

    4. Tuple: Tuple is a collection that is ordered and unchangeable. In the Python tuple, you can access it by retrieving index numbers.

      It is denoted by round brackets ().

    5. Sets: A set is an unindexed collection. In Python sets cannot access by retrieving the data.

      It is denoted by curly brackets {}

    6. Dictionaries: the dictionary is a collection that is unordered, changeable and indexed.

      It is written in curly brackets and they have the key and the values.

Happy Learning,