FAQ Part 1: Introduction to Python

What is Python?

Python is a high-level, interpreted programming language known for its simplicity, readability, and versatility. It supports multiple programming paradigms, including procedural, object-oriented, and functional programming.

Why should I learn Python?

Python is widely used in web development, data science, automation, AI, scientific computing, and more. Its simple syntax makes it a great first language.

How do I install Python?

Download Python from python.org. Follow the instructions for your OS. Be sure to check the “Add Python to PATH” option during installation.

What is the difference between Python 2 and Python 3?

Python 3 is the future of the language and is not backward-compatible with Python 2. Always use Python 3 for new projects.

What is the difference between CPython, Jython, and PyPy?

  • CPython: The default and most widely used implementation written in C.
  • Jython: Runs on the Java Virtual Machine (JVM); integrates with Java.
  • PyPy: Uses a JIT (Just-In-Time) compiler to offer faster execution in many cases.

Is Python case-sensitive?

Yes. Variable, variable, and VARIABLE are considered different identifiers.

What file extension do Python programs use?

Python source files use the .py extension. Compiled bytecode files use .pyc.

How do I run a Python script from the command line?

python script.py

You may need to use python3 instead of python, depending on your system.

What are some popular Python IDEs and editors?

  • VS Code – lightweight and highly customizable
  • PyCharm – full-featured IDE, great for professional development
  • Thonny – beginner-friendly and simple
  • Jupyter Notebook – ideal for data science and exploratory coding

What is the Python Standard Library?

A collection of built-in modules and packages that provide functionality such as file I/O, system calls, web services, math operations, and more—without needing to install external libraries.

What is pip and how do I use it?

pip is Python’s package installer. You can install libraries like this:

pip install package_name

What are Python virtual environments and why should I use them?

Virtual environments allow you to isolate dependencies for different projects, preventing version conflicts:

python -m venv myenv
source myenv/bin/activate  # On Unix/macOS
myenv\Scripts\activate     # On Windows

What is an interpreter and how does it differ from a compiler?

An interpreter executes code line by line (like Python), while a compiler translates code into machine code before execution (like C++). Python’s interpreter makes it more flexible but often slower than compiled languages.

What are REPL and the interactive Python shell?

REPL stands for Read–Eval–Print Loop. It allows you to run Python commands one at a time interactively:

$ python
>>> print("Hello")