π Introduction to Python
β What is Python?
Python is a high-level, interpreted, general-purpose programming language known for its:
- Simple syntax (easy to read/write)
- Large community support
- Powerful libraries for Data Science, Web Development, Automation, AI/ML, etc.
π₯ Why Learn Python?
- Used by companies like Google, Facebook, Netflix.
- Great for web development, data science, automation, AI, machine learning, and more.
- Beginner-friendly and versatile.
π» How to Install Python
π Step 1: Check if Python is Already Installed
Open terminal (Linux/Mac) or command prompt (Windows):
python --version
# OR
python3 --versionIf Python is installed, you’ll see a version like Python 3.11.2. If not, follow below steps:
πͺ Windows Installation
- Go to the official website:
π https://www.python.org/downloads/ - Click on “Download Python 3.x.x”.
- Run the installer:
- β Check the box: βAdd Python to PATHβ
- Then click Install Now
- Verify installation:
Open Command Prompt and type: bashCopyEditpython --version
π§ Linux Installation
Ubuntu/Debian:
sudo apt update
sudo apt install python3
python3 --versionFedora:
sudo dnf install python3
python3 --versionπ Mac Installation
Option 1: Use Homebrew (recommended)
brew install python
python3 --version
Option 2: Direct download from https://www.python.org/downloads/mac-osx/
β Test Your Installation
Open terminal/command prompt and type:
python3You should see the Python interactive shell:
>>> print("Hello, Python!")
Hello, Python!