Quick Guide
Get Started With Python
This section helps you start working with Python step by step.
You will learn how to install Python, run your first program, check Python versions, and use Python from the command line.
Python Install
To start using Python, you must first install Python on your system.
Python is available for Windows, macOS, and Linux.
After installation, Python provides:
- Python Interpreter
- Command Line Tool
- Standard Library
Important
Always install the latest stable version of Python for best features and security.
Code Example 1: Check if Python Is Installed
bash
python --version
Code Example 2: Alternative Command (Some Systems)
bash
python3 --version
Python Quickstart
Python allows you to write and run code immediately without complex setup.
You can run Python code using:
- Interactive Mode
- Script Files
Python is often used to quickly test ideas and logic.
Beginner Tip
Python is great for learning because you can see results instantly.
Code Example 1: First Python Program
python
print("Hello, World!")
Code Example 2: Simple Calculation
python
print(10 + 20)
Python Version
Python has multiple versions, but the two major ones are:
- Python 2 (deprecated)
- Python 3 (actively used)
Today, Python 3 is the standard and should always be used.
Caution
Python 2 is no longer supported. Always use Python 3.
Code Example 1: Check Python Version
bash
python --version
Code Example 2: Version Inside Python
python
import sys
print(sys.version)
The Python Command Line
The Python Command Line allows you to:
- Run Python interactively
- Execute scripts
- Test small pieces of code
It is very useful for learning and debugging.
Key Concept
The Python Command Line is also called the Python Shell.
Code Example 1: Start Python Command Line
bash
python
Code Example 2: Run Python Code in Command Line
python
print("Welcome to Code Marathi")