Day 13: Basics of Python

  • Python is a high-level programming language that was first released in 1991. It was created by Guido van Rossum and is now maintained by the Python Software Foundation.

  • Python is a high-level, interpreted programming language that emphasizes simplicity, readability, and ease of use. It is widely used for web development, scientific computing, data analysis, and machine learning, among other applications, and is known for its vast library of modules and ease of integration with other languages and tools.

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:

TASK-1 Windows Installation:

  • Install Python on Windows | Learn 7 Useful Steps to Install Python

    You can install Python on Windows 10 by following these steps:

    1. Go to the official Python website at python.org/downloads.

  1. Click on the "Download Python" button for the latest version of Python (currently version 3.11.2 as of my knowledge cutoff date).

  2. Scroll down to the "Files" section and click on the appropriate installer for your system (32-bit or 64-bit). If you're not sure which one to choose, select the 64-bit version.

4. Once the installer has been downloaded, run it by double-clicking on the file.

  1. Follow the prompts in the installation wizard to install Python. During the installation, you may be prompted to customize the installation or choose additional features; you can usually just leave the defaults and continue.

  1. Once the installation is complete, you should be able to run Python by opening the Command Prompt and typing "python" (without the quotes) at the prompt. If Python is installed correctly, you should see the Python version number displayed.

Congratulations, you have successfully installed Python on Windows 10

Task -2: Install Python On**(Ubuntu), and check the version.**

How To Install Python 3.8 On Ubuntu 18.04 LTS | Tutorials24x7

  1. Run this command:

       sudo apt update
    

  2. Verify the installation by typing the following command and pressing Enter:

       python3 --version
    

    This will display the version of Python that you have installed.

  3. (Optional) You can also install pip, which is the package installer for Python, by typing the following command and press Enter:

       sudo apt install python3-pip
    

    Once you have installed pip, you can use it to install packages for Python.

  4. That's it! You now have Python installed on your Ubuntu system.

TASK-3 Read about different Data Types in Python.

Data Types - Python - PYTHON - Programming Language丨Your Way To Success

Python has several built-in data types that are used to represent different kinds of data. These include:

  1. Numeric data types: Numeric data types in Python are used to represent numbers. There are three main types of numeric data types in Python:

    a. Integer (int): This data type is used to represent whole numbers, both positive and negative, without any decimal point.

    b. Float (float): This data type is used to represent floating-point numbers, which are numbers that have a decimal point.

    c. Complex (complex): This data type is used to represent complex numbers, which are numbers that have real and imaginary parts.

  2. String data type: String data type in Python is used to represent a sequence of characters. A string is enclosed in quotation marks (' ' or " ").

  3. Boolean data type: Boolean data type in Python is used to represent the truth value of an expression. It has only two possible values: True or False.

  4. List data type: A list is an ordered collection of elements, which can be of different data types. Lists are mutable, which means that you can change the elements of a list.

  5. Tuple data type: A tuple is an ordered collection of elements, similar to a list. However, tuples are immutable, which means that you cannot change the elements of a tuple once it is created.

  6. Set data type: A set is an unordered collection of unique elements. Sets are mutable, which means that you can add or remove elements from a set.

  7. Dictionary data type: A dictionary is an unordered collection of key-value pairs. Each key in a dictionary must be unique, and the keys are used to access the corresponding values.

Thank you for Reading :)

Shubham Jangale