document

Page 12

Interpreter vs. Compiler

  • Interpreter: Executes code line by line.

  • Compiler: Translates entire code at once (C, C++, Java).

Page 13

Compiler vs. Interpreter Comparison

  • Interpreter: Takes single instruction, slower, no intermediate object code.

  • Compiler: Takes entire program as input, faster, intermediate object code is generated.

Page 14

Download Python

  • Latest stable version: 3.12.6 (released September 6, 2024).

Page 15

Python Downloads

  • Website: python.org/downloads

  • Various versions available for Windows, Linux, macOS.

Page 16 - Page 17

Installation Instructions

  • Installation options, setting environment variables (PATH), and selection of features during installation.

Page 18

Setup Progress

  • Initializing the Python setup.

Page 19

Installation Status

  • Test Suite and installation confirmation of Python 3.9.7

Page 20

Post-Installation Steps

  • Launching Python and accessing tutorials/documentation.

Page 21 - Page 24

Python Shell

  • Interactive environment for executing commands; displaying Python version and interpreter prompt.

Page 25

Setting Up Python Interpreter

  • Importance of IDLE (Integrated Development and Learning Environment) for writing and running Python programs.

Page 26

Basic Programming Example

  • Python Code (Hello World): print('Hello, World!')

  • C Code (Hello World): #include <stdio.h>...

Page 27

Addition Example

  • Python Code:

    • num1 = 1.5

    • num2 = 6.3

    • print('total', sum)

  • C Code: Includes int and sum calculations.

Page 28

Modes of Execution

  • Overview of Python execution modes.

Page 29

Python Interpreter Modes

  1. Interactive Mode

  2. Script Mode

Page 30 - Page 36

Interactive Mode

  • Allows interaction with command line, immediate results, but does not save statements.

Page 37

Script Mode

  • Save scripts as .py files, execute via interpreter, allows editing and saving.

Page 38

Further Details

  • For more information, refer to additional resources.

Page 39

Python IDLE Explained

  • Built-in IDE for beginners; allows editing and executing Python code.

Page 40

Interactive Interpreter

  • REPL functionality for experimentation; launched through command line or IDLE.

Page 41

File Editing

  • Python programs are saved as .py files; Python IDLE provides editing capabilities.

Page 42

Interacting with Python

  • Blank interpreter window can receive code input directly.

Page 43

User Input Example

  • Code snippet demonstrating user interaction with Python.