Day - 13 DevOps challenge

Day - 13 DevOps challenge

Basics of Python

✔️ What is Python?

Python is a versatile programming language widely used in computer engineering. It offers a simple and readable syntax, making it beginner-friendly and efficient for rapid prototyping. Python supports various paradigms, including object-oriented, functional, and procedural programming. It has a vast ecosystem of libraries and frameworks for tasks such as data analysis, machine learning, and web development. Python's integration capabilities and extensive community support make it an essential tool for computer engineers.

✔️ How to install Python:

  1. Visit the official Python website at python.org.

  2. Navigate to the Downloads section and choose the appropriate version for your operating system (e.g., Windows, macOS, Linux).

  3. Download the installer package corresponding to your operating system.

  4. Run the installer package and follow the on-screen instructions.

  5. Select the option to add Python to your system's PATH environment variable (if available) during the installation process.

  6. Choose the installation location or leave it as the default.

  7. Complete the installation by clicking "Install" or "Finish" (depending on the installer).

  8. Open a command prompt or terminal window.

  9. Type "python" or "python3" in the command prompt and press Enter to verify the installation and check the Python version.

  10. If the installation was successful, you should see the Python interpreter prompt, indicating that Python is installed and ready to use.

✔️ Install python in Linux:

  1. Open a terminal window.

  2. Update the package manager's repository information by running the following command:

     sudo apt update
    
  3. Install Python by running the appropriate command based on your version :

    For Python 2

     sudo apt install python2
    

    For Python 3

     sudo apt install python3
    
  4. During the installation, you may be prompted to confirm the process. Type 'Y' and press Enter to proceed.

  5. Once the installation is complete, you can verify it by typing the following command:

    For Python 2

     python2 --version
    

    For Python 3

     python3 --version
    

    This will display the installed Python version.

✔️data types in Python:

None Type:

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

Boolean Type:

  • bool: Represents either True or False.

Set Types:

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

  • frozenset: Immutable set, e.g., frozenset({1, 2, 3}).

Mapping Type:

  • dict: Collection of key-value pairs, e.g., {'name': 'John', 'age': 25}.

Numeric Types:

  • int: Integer values, e.g., 5, -3, 0.

  • float: Floating-point values with decimal points, e.g., 3.14, -0.5, 2.0.

Sequence Types:

  • str: String of characters, e.g., "Hello, World!", 'Python'.

  • list: Ordered collection of items, e.g., [1, 2, 3], ['apple', 'banana', 'cherry'].

  • tuple: Immutable ordered collection of items, e.g., (1, 2, 3), ('a', 'b', 'c').

To check what is the data type of the variable used, we can simply write: type(your_variable)

example:

a = 20
type (a)

The answer will be:

< class 'init' >

For another python-related blogs.

Follow me on LinkedIn to see interesting posts like this : )

linkedin.com/in/prabir-kumar-mahatha-6a0025..

visit my git hub profile: github.com/PrabirKumarMahatha