Skip to main content

Command Palette

Search for a command to run...

Day13 of 90daysofdevopschallenge

Updated
2 min readView as Markdown
Day13 of 90daysofdevopschallenge
K

Aspiring Devops engineer

Let's Start with Basics of Python as this is also important for Devops Engineer to build the logic and Programs.

What is Python?

  • Python is a 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 window, MacOS, ubuntu, centos etc. Below are the links for the installation:

Task1:

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

    to check version of python

    PS C:\Users\DELL\Documents\devops notes\masterclass> sudo apt update

    sudo apt install python

  2. To check version of python run the following command:

    python --version Python 3.10.11

  3. Read about different Data Types in Python.

    Variables can store data of different types, and different types can do different things.

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

    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

    1. Numeric Types:
  • int: Integer values, e.g., 45,20,15

  • float: Floating-point values (decimal numbers), e.g., 2.5,5.12,3.18

    1. Text Type:
  • String: Represents strings of characters e.g., "Welcome to python learning"

  1. Boolean Type:

    • bool: Represents truth values True or False.
  2. Sequence Types:

    • list: Ordered, mutable (changeable) sequence of elements, e.g., [1, 2, 3], ['apple', 'banana'].

    • tuple: Ordered, immutable (unchangeable) sequence of elements, e.g., (1, 2, 3), ('a', 'b').

    • range: Represents an immutable sequence of numbers, often used for iteration, e.g., range(5).

  3. Mapping Type:

    • dict: Unordered collection of key-value pairs, e.g., {'name': 'Kavita', 'age': 29}.
  4. Set Types:

    • set: Unordered collection of unique elements, e.g., {1, 2, 3}, {'apple', 'banana'}.

    • frozenset: Immutable version of a set.

  5. Binary Types:

    • bytes: Immutable sequence of bytes, e.g., b'hello'.

    • bytearray: Mutable sequence of bytes.

    • memoryview: Represents the memory view of an object, exposing the buffer interface.

  6. None Type:

    • None: Represents the absence of a value or a null value.

These are the fundamental built-in data types in Python. Hope this article helped you to clear your python basics. Thanks for reading and appreciation.

Kavita Pant

More from this blog

Untitled Publication

38 posts