Loops and Iteration

Loops and Iteration

For Loops and While Loops 1. For Loops Purpose: Used to iterate over a sequence (like a list, string, tuple, range, etc.) Syntax: for variable in iterable: # code block Example 1: Looping through a list fruits = [“apple”, “banana”, “cherry”] for fruit in fruits: print(fruit) Output: apple banana cherry Example 2: Using range() for … Read more

Functions

Functions

Defining and calling functions What Are Functions? A function is a block of reusable code that performs a specific task. You define functions to avoid repeating code, enhance readability, and make your code more modular. 1. Defining a Function To define a function, you use the def keyword followed by the function name, parentheses, and … Read more

Data Structures

Data Structures

Lists and list methods What Are Lists in Python? A list is a built-in data structure in Python that is used to store multiple items in a single variable. Lists are ordered, mutable, and can contain elements of mixed data types (strings, numbers, booleans, other lists, etc.). List Syntax my_list = [1, 2, 3, “hello”, … Read more

Control Flow

Control Flow

if, elif, and else statements These statements let your program make decisions based on conditions — they’re the core of control flow in Python. Basic Syntax if condition: # code block if condition is True elif another_condition: # code block if elif is True else: # code block if none are True Each condition is … Read more

Variables, Data Types and Operators

Variables, Data Types & Operators

Variables and Naming Conventions What is a Variable? A variable is a name that stores a value. Think of it as a labeled box where you can put data and use it later in your code. x = 5 name = “Alice” is_logged_in = True You use the = symbol (assignment operator) to assign a … Read more

Introduction to Python

Introduction to Python

What is Python and why use it? What is Python and Why Use It? What is Python? Python is a high-level, general-purpose programming language that is easy to read, write, and learn. It was created by Guido van Rossum and first released in 1991. Today, it’s one of the most popular programming languages in the … Read more

Working with Strings

Working with Strings

String methods and formatting What Is a String? A string is an immutable sequence of characters used to represent text in Python. Strings are enclosed in single quotes ‘…’, double quotes “…”, or triple quotes ”’…”’/”””…””” for multi-line strings. greeting = “Hello, world!” Common String Methods String methods are built-in functions you can use to … Read more

File Handling

File Handling

Reading and writing files What Is File Handling? File handling lets you read from, write to, and modify files stored on your computer. Python uses the built-in open() function to interact with files. Opening a File file = open(“example.txt”, “mode”) Modes: Mode Description ‘r’ Read (default mode) ‘w’ Write (overwrites existing file) ‘a’ Append to … Read more

Error Handling

Error Handling

Try, Except, Else, Finally What Is Exception Handling? In Python, exceptions occur when an error disrupts the normal flow of a program (like dividing by zero or opening a non-existent file). Instead of crashing, you can catch and handle these errors using try and except. Basic Syntax try: # Code that might raise an exception … Read more

Object-Oriented Programming (OOP)

Object-Oriented Programming (OOP)

Classes and objects What Are Classes and Objects? A class is a blueprint for creating objects — a way to bundle data and functionality together. An object is an instance of a class, representing a specific implementation of that blueprint. Defining a Class class Dog: def __init__(self, name, breed): self.name = name # attribute self.breed … Read more

Modules and Packages

Modules and Packages

Importing modules What Is a Module? A module is a file containing Python definitions and statements, such as functions, variables, and classes. Modules allow you to logically organize your Python code by grouping related functions, classes, and variables into separate files. This way, you can reuse code across multiple programs. How to Import a Module … Read more

Intermediate Topics

Intermediate Topics

List comprehensions (advanced) List comprehensions are a powerful and expressive way to create lists in Python using a single line of code. While basic list comprehensions handle simple transformations, advanced list comprehensions allow for more complex logic, including conditional filtering, nested loops, and function application. Basic Structure (Recap) [expression for item in iterable if condition] … Read more

Working with External Libraries

Working with External Libraries

Requests, Pandas, Matplotlib, etc. Popular Python Libraries – Detailed Overview Python has a rich ecosystem of libraries that simplify everything from web requests to data manipulation and visualization. Here’s a breakdown of some of the most widely used libraries: requests, pandas, matplotlib, and more. 1. Requests – HTTP for Humans The requests library is a … Read more

Next Steps

Next Steps

Introduction to frameworks: A framework in Python is a collection of pre-written code and tools that provides a structured foundation for building applications, allowing developers to focus more on functionality and less on repetitive setup. Frameworks speed up development, enforce best practices, and reduce errors. Why Learn Frameworks? Faster development with built-in tools Promotes code … Read more

Introduction to HTML

Introduction to HTML

What is HTML? HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. Every website you visit is built on HTML in some form—it’s the foundation of all web pages. Breaking It Down HyperText Refers to text that links to other text or documents. This … Read more

Text and Formatting Elements

Text and Formatting Elements

Headings and paragraphs Headings and paragraphs are essential building blocks for structuring and organizing content on a webpage. Understanding how to use them properly ensures a well-structured, accessible, and readable page. Headings (<h1> to <h6>) What are Headings? Headings are used to define titles or subtitles within the content. They help organize the content and … Read more

Hyperlinks and Navigation

Hyperlinks and Navigation

Creating links with <a> The <a> tag in HTML is used to create hyperlinks, allowing users to navigate between web pages, download files, or jump to sections within the same page. Basic Syntax <a href=”URL”>Link Text</a> href: Specifies the destination URL of the link. Link Text: The clickable part shown to the user. Example: <a … Read more

Working with Images and Media

Working with Images and Media

Embedding images using <img> The <img> tag in HTML is used to embed images into a webpage, helping enhance visual appeal and user understanding. It is a self-closing tag and does not require a closing tag. Basic Syntax <img src=”image.jpg” alt=”Description of image”> Attributes: Attribute Purpose src (Required) URL or path to the image file … Read more

Tables

Tables

Structure of a table: <table>, <tr>, <td>, <th> HTML tables are used to display tabular data (like spreadsheets or schedules) in a structured row-and-column format using key tags: <table>, <tr>, <td>, and <th>. Basic Tags and Their Roles Tag Meaning Description <table> Table container Wraps all table elements (rows and cells) <tr> Table row Defines … Read more

Forms and User Input

Forms and User Input

Introduction to <form> and attributes The <form> element in HTML is used to collect user input and submit data to a server or process it with JavaScript. It’s essential for creating interactive features like login pages, surveys, contact forms, and more. What is a <form>? The <form> tag defines an HTML form and acts as … Read more

Semantic HTML and Structure

Semantic HTML and Structure

Semantic tags: <header>, <nav>, <section>, <article>, <footer> Semantic tags in HTML give meaning to the structure of a web page, helping both developers and browsers (including assistive technologies like screen readers) understand the content and layout better. Here’s a breakdown of commonly used semantic tags: 1. <header> – Page or Section Introduction Represents the introductory … Read more

Metadata and Head Elements

Metadata and Head Elements

The <head> section: title, meta tags, favicon The <head> element is a crucial part of every HTML document. It contains metadata—information about the page that isn’t directly displayed to users but is essential for browsers, search engines, and other tools. Structure Example: <head> <title>My Website</title> <meta charset=”UTF-8″> <meta name=”description” content=”A simple HTML page.”> <meta name=”viewport” … Read more

Project and Best Practices

Project and Best Practices

Build a portfolio website or resume page Creating a portfolio or resume website is an excellent project to showcase your skills, highlight your experience, and impress potential employers or clients. Here’s a complete breakdown of what to include and how to build it step by step. 1. Basic Structure Start with a clean HTML5 skeleton: … Read more

HTML5 Features

HTML5 Features

New input types (date, range, color, etc.) HTML5 introduced several new input types that enhance user experience, improve form validation, and reduce the need for custom JavaScript. These input types allow users to interact with forms more intuitively using browser-native controls. <input type=”date”> – Date Picker Description: Provides a calendar-based date selector. Example: <label for=”dob”>Date … Read more

Introduction to JavaScript

Introduction to JavaScript

What is JavaScript? JavaScript is a powerful, high-level programming language that is primarily used to make web pages interactive and dynamic. It is one of the core technologies of the web, alongside HTML and CSS. Definition: JavaScript (often abbreviated as JS) is a scripting language that runs in the browser and allows you to create: … Read more

Basics and Syntax

Basics and Syntax

Variables (let, const, var) 1. What Are Variables? Variables store data values that can be used and manipulated in your code. let name = “Alice”; const age = 30; var city = “Paris”; 2. let – Block-scoped, Reassignable Introduced in ES6 (2015), let is the go-to for variables that can change. let counter = 1; … Read more

Control Flow

Control Flow

Conditional statements (if, else, else if 1. What Are Conditional Statements? Conditional statements allow you to execute code based on conditions — they control flow and logic. if (condition) { // code runs if condition is true } else if (anotherCondition) { // runs if first is false, this is true } else { // … Read more

Loops and Iteration

Loops and Iteration

for, while, and do…while loops Loops allow you to repeat a block of code as long as a condition is true. JavaScript provides several types of loops — each suited for different scenarios. 1. for Loop Best For: When the number of iterations is known Looping through arrays or counters Syntax: for (initialization; condition; increment) … Read more

Functions and Scope

Functions and Scope

Function Declaration and Expression Function Declaration A Function Declaration is the traditional way of defining a named function in the main code flow. Syntax: function functionName(parameters) { // code block } Example: function add(a, b) { return a + b; } console.log(add(2, 3)); // Output: 5 Key Features: Named function (like add above). Hoisted: Can … Read more

Arrays and Objects

Arrays and Objects

Creating and modifying arrays What is an Array? An array is a special variable that can hold multiple values at once, organized in an ordered collection. Each value is called an element, and each has a numeric index starting from 0. 1. Creating Arrays Using Square Brackets let fruits = [“apple”, “banana”, “cherry”]; console.log(fruits); // … Read more