Day 13 - Introduction to Python ๐Ÿ

Priyam KunduPriyam Kundu
2 min read

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 in windows, Mac, linux? ๐Ÿ—

Here's a general guide on how to install Python on Windows, Mac, and Linux

Windows:

  1. Download Python: Visit the official Python website (python.org) and download the latest version of Python for Windows.

  2. Run Installer: Once the download is complete, run the installer. Make sure to check the box that says "Add Python to PATH" during installation.

  3. Verify Installation: Open Command Prompt and type python --version to verify that Python is installed correctly.

Mac:

  1. Homebrew (Recommended): If you have Homebrew installed, you can simply run brew install python.

  2. Download Python: Alternatively, you can download Python from the official website (python.org) for macOS.

  3. Run Installer: Open the downloaded file and follow the installation instructions. Make sure to check the box that says "Add Python to PATH" during installation.

  4. Verify Installation: Open Terminal and type python --version to verify that Python is installed correctly.

Linux (Ubuntu/Debian):

  1. Package Manager: Most Linux distributions come with Python pre-installed. If not, you can use your package manager to install it. For example, on Ubuntu/Debian, you can use sudo apt-get install python3.

  2. Verify Installation: Open Terminal and type python3 --version to verify that Python is installed correctly.

For other Linux distributions, you can use their respective package managers to install Python.

Different Data Types in Python

In Python, there are several built-in data types. Some of the most common ones include:

  1. Integer (int): Represents whole numbers without any decimal point.

  2. Float (float): Represents numbers with a decimal point or in exponential form.

  3. String (str): Represents sequences of characters, enclosed in single (' '), double (" "), or triple (''' ''' or """ """) quotes.

  4. Boolean (bool): Represents the values True or False.

  5. List (list): Represents an ordered collection of items, which can be of different data types. Lists are mutable.

  6. Tuple (tuple): Similar to lists but immutable (cannot be changed after creation). Enclosed in parentheses.

  7. Dictionary (dict): Represents an unordered collection of key-value pairs. Keys must be unique and immutable, while values can be of any data type.

  8. Set (set): Represents an unordered collection of unique items. Sets do not allow duplicate elements.

  9. NoneType (None): Represents the absence of a value or a null value.

These are the basic built-in data types in Python, and there are also additional data types available through modules and libraries.

0
Subscribe to my newsletter

Read articles from Priyam Kundu directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Priyam Kundu
Priyam Kundu

Hi there ๐Ÿ‘‹ I'm Priyam Kundu, a final year undergrad from Kolkata and an aspiring DevOps & Cloud โ˜๏ธ professional. As an aspiring DevOps engineer with a keen interest in Cloud โ˜๏ธ and DevOps, I'm here to grow and expand my knowledge in this field๐Ÿš€. Looking forward to sharing my experiences and learning from all of you passionate professionals.