Basics
Python Installation
Installing Python 3.12
Python installation sets up version 3.12 with pip and venv for environments.
System Requirements
Before installing Python 3.12, ensure your system meets the following requirements:
- Operating System: Windows, macOS, or Linux
- Processor: 1 GHz or faster
- RAM: At least 512 MB
- Disk Space: 100 MB of free space
Download Python 3.12
To download Python 3.12, visit the official Python website at python.org/downloads. Choose the appropriate installer for your operating system.
Installation on Windows
Follow these steps to install Python 3.12 on Windows:
- Run the downloaded installer.
- Make sure to select the option 'Add Python 3.12 to PATH'.
- Click 'Install Now' and follow the prompts to complete the installation.
Installation on macOS
To install Python 3.12 on macOS, open the downloaded package and follow these steps:
- Double-click the installer package.
- Follow the instructions in the installer to complete the installation.
Installation on Linux
For most Linux distributions, you can install Python 3.12 using the package manager:
sudo apt update
sudo apt install python3.12
Setting Up Virtual Environments
Python's venv
module allows you to create isolated environments for your projects. This helps prevent dependency conflicts. To create a virtual environment:
Activate the virtual environment:
Once activated, you can install packages using pip
without affecting the global Python installation:
Basics
- Introduction
- Installation
- Running Code
- Syntax
- Variables
- Data Types
- Numbers
- Strings
- Booleans
- Type Conversion
- Operators
- Ternary Operator
- If Else
- Match Case
- While Loops
- For Loops
- Lists
- Tuples
- Dictionaries
- Sets
- Comprehensions
- Functions
- Arguments
- Scope
- Errors
- Debugging
- String Formatting
- Security Basics
- Best Practices
- User Input
- Built-in Functions
- Keywords
- Previous
- Introduction
- Next
- Running Code