Introduction to Python

Module Overview
Python is a high-level, interpreted programming language created by Guido van Rossum and first released in 1991. It is designed to be easy to read and write, making it an excellent choice for beginners and professionals alike.

LEARNING OUTCOMES

  • • Understand the Basics of Python
  • • Write Basic Python Programs
  • • Control Program Flow
  • • Work with Functions
  • • Handle Data Structures
  • • Perform Input and Output Operations
  • •Debug and Test Code
  • • Develop Simple Applications
  • Unit 1: Understanding the Web and Python

    Python is a high-level, interpreted programming language that is widely used for web development, data analysis, automation, and artificial intelligence (AI). When learning web development, Python is primarily used for server-side programming, meaning it runs on the web server to process data, handle user requests, and generate dynamic web content.

    KEY TERMS

  • • Python – A high-level, interpreted programming language used for web development, data science, automation, and AI.
  • • Variable – A building block of an HTML page
  • • Data Types – A name used to store data values
  • • Constant – A value that should not change. By convention, constants are written in uppercase.
  • • Operator – Symbols used to perform operations on values, e.g., +, -, *, /, ==
  • • Function – A reusable block of code that performs a task.
  • • Loop – Repeats a block of code multiple times. Example: for or while.
  • • Conditional Statement – Executes code based on a condition: if, elif, else.
  • • Module / Library – A file or collection of Python code that can be imported and reused.
  • • Comment – Notes in the code ignored by Python, used for explanation
  • • Input / Output – INPUT () → Get data from the user
    PRINT() → Display data to the screen
  • • Exception / Error – An error that occurs during program execution. Can be handled using try and except
  • • Class / Object – CLASS: Blueprint for creating objects
    OBJECT: Instance of a class with attributes and methods
  • • Syntax – Rules that define how Python code must be written.
  • • Indentation – Python uses indentation (spaces or tabs) instead of braces {} to define blocks of code.
  • Unit 2: Python Document Structure

    A Python program is typically saved with a .py file extension and follows a simple, readable structure. Understanding this structure helps beginners write organized and efficient code.

    CORE STRUCTURE COMPONENTS

  • • Comments
  • • Variables and Constants
  • • Data Types
  • • Statements and Expressions
  • • Functions
  • • Conditional Statements
  • • Loops
  • • Modules / Libraries
  • • Main Program / Execution Flow
  • Unit 3: Text and Content Elements

    HTML provides various elements for displaying text content. Headings create hierarchy, while paragraphs organize readable text blocks. Inline elements such as strong and emphasis help highlight important information within paragraphs.

    COMMON TEXT ELEMENTS

  • • Headings (h1 to h6)
  • • Paragraphs (p)
  • • Bold text (strong)
  • • Italic text (em)
  • hover any card → interactive glow, shift, and icons respond

    interactive ✦