Day 13 - Introduction to Python ๐
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:
Download Python: Visit the official Python website (python.org) and download the latest version of Python for Windows.
Run Installer: Once the download is complete, run the installer. Make sure to check the box that says "Add Python to PATH" during installation.
Verify Installation: Open Command Prompt and type
python --version
to verify that Python is installed correctly.
Mac:
Homebrew (Recommended): If you have Homebrew installed, you can simply run
brew install python
.Download Python: Alternatively, you can download Python from the official website (python.org) for macOS.
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.
Verify Installation: Open Terminal and type
python --version
to verify that Python is installed correctly.
Linux (Ubuntu/Debian):
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
.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:
Integer (
int
): Represents whole numbers without any decimal point.Float (
float
): Represents numbers with a decimal point or in exponential form.String (
str
): Represents sequences of characters, enclosed in single (' '), double (" "), or triple (''' ''' or """ """) quotes.Boolean (
bool
): Represents the values True or False.List (
list
): Represents an ordered collection of items, which can be of different data types. Lists are mutable.Tuple (
tuple
): Similar to lists but immutable (cannot be changed after creation). Enclosed in parentheses.Dictionary (
dict
): Represents an unordered collection of key-value pairs. Keys must be unique and immutable, while values can be of any data type.Set (
set
): Represents an unordered collection of unique items. Sets do not allow duplicate elements.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.
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.