Q1. How do you install Python on Windows?
Download the installer from python.org. Run the executable, ensure to check "Add Python to PATH", then proceed with installation. Verify by opening Command Prompt and typing
python --versionQ2. How do you install Python on macOS?
macOS often comes with Python 2 pre-installed. Install Python 3 using Homebrew:
brew install python or download the installer from python.org. Use python3 command to run Python 3.Q3. How do you install Python on Linux?
On Ubuntu/Debian:
sudo apt update
sudo apt install python3 python3-pip On Fedora: sudo dnf install python3Q4. What is pip and how do you use it?
pip is the package installer for Python. It installs packages from the Python Package Index (PyPI). Common commands:
pip install package_name
pip uninstall package_name
pip listQ5. What is a virtual environment and why use it?
A virtual environment is an isolated Python environment that allows you to manage dependencies separately for different projects. It prevents version conflicts. Create with
python -m venv myenv Activate with source myenv/bin/activate (Linux/macOS) or myenvScriptsactivate (Windows).