
Already know some of this? A 2-minute test skips the lessons you know.
Take the placement testA free 71-lesson course built from Shradha Khapra's 8h 57m of YouTube playlist. 6 days at 90 minutes a day, with study notes and a quiz in every lesson. A 2-minute placement test skips what you already know.
Taught by Shradha Khapra on YouTube. Videos play in YouTube's own player, so the creator keeps every view.
Understand what programming is, how computers interpret code, and why Python is a popular high-level language.
Install Python on Windows and macOS, verify the installation, and set up Visual Studio Code as the code editor.
Create a .py file, use the print() function to display output, and run the program in VS Code.
Print multiple items on one line using commas, print numbers, and perform arithmetic operations inside print().
Define variables as named memory locations, assign values using the assignment operator, and understand value mutability.
Distinguish between string, int, and float types, use quotes correctly for strings, and check types with type().
Apply Python's identifier rules (start with letter/underscore, alphanumeric/underscore only) and choose meaningful names.
Print variable values by omitting quotes, combine variables with text using commas, and avoid printing variable names as literals.
Reassign new values to existing variables, understand memory address changes, and copy values between variables.
Use +, -, *, /, %, ** operators for addition, subtraction, multiplication, division, modulus, and exponentiation.
Compare values using ==, !=, >, <, >=, <= to produce Boolean True/False results.
Apply compound assignment operators (+=, -=, *=, /=, %=, **=) to update variable values concisely.
Combine Boolean values with not, and, or operators and evaluate compound logical expressions.
Distinguish implicit type conversion (int to float) from explicit type casting using int(), float(), str() functions.
Capture user input as strings, convert to numeric types with int() or float(), and use the values in calculations.
Create strings using single, double, and triple quotes, and choose quote types to embed apostrophes or quotation marks inside string values.
Join strings with the + operator and measure string length with len(), counting every character including spaces and symbols.
Extract substrings using slice notation [start:end] where start is inclusive and end is exclusive, and omit indices to default to string boundaries.
Use built-in methods such as endswith(), capitalize(), replace(), find(), and count() to inspect and transform string data.
Solve two classic exercises: test divisibility by 2 with the modulo operator, and find the largest of three numbers using chained comparisons.
Check if a number is a multiple of 7 (remainder zero) and generalize the pattern to test divisibility by any integer.
Create lists to store multiple values in a single variable and access elements using indexing.
Manipulate lists using built-in methods for adding, sorting, reversing, inserting, removing, copying, and counting elements.
Create tuples, understand their immutability, and perform indexing and slicing operations.
Determine whether a list reads the same forwards and backwards using copy and reverse methods.
Understand dictionaries as key-value stores, create them with curly braces, and use strings, numbers, booleans, lists, and tuples as values.
Learn valid key types (hashable/immutable), dictionary mutability, duplicate key behavior, and how to access, update, or add values using square brackets.
Use .keys(), .values(), .items() to retrieve views of dictionary data, convert them to lists, and safely fetch values with .get() to avoid KeyError.
Create sets with curly braces, observe automatic duplicate removal and random ordering, and understand why empty sets require set() not {}.
Apply union and intersection operations to combine unique values or find common elements between two sets, mirroring mathematical set theory.
Solve practice questions involving nested dictionaries for student marks, counting unique subjects with sets, and storing distinct 9 and 9.0 using strings or tuples.
Understand why loops are needed, learn the syntax and flow of a while loop, and write a basic while loop with a counter variable to repeat code a specific number of times.
Solve practice problems using while loops: print numbers 1 to 100, print in reverse 100 to 1, and generate a multiplication table for a user-provided number.
Identify and avoid infinite loops by ensuring the iterator updates correctly, then use a while loop with an index variable to traverse and print all elements of a list.
Control loop flow using break to exit early (e.g., stop after finding an item) and continue to skip the current iteration (e.g., print only odd numbers).
Learn for loop syntax for sequential traversal of lists, tuples, and strings, and understand when to choose for loops over while loops.
Use the optional else block with a for loop to run code only when the loop completes without a break, demonstrated by searching for a character in a string.
Write programs to calculate the sum of the first n natural numbers using a for loop and the factorial of a number using both while and for loops.
Understand what functions are, why they reduce code redundancy, and how to define and call a basic function with parameters and return values.
Learn the terms function definition, parameters, arguments, function call, and return value; create functions with and without parameters and return statements.
Distinguish built-in from user-defined functions; explore the print function's parameters (sep, end) to control output formatting.
Write functions to print the length of a list and to print all list elements on a single line using a for loop and the end parameter.
Implement an iterative factorial function and a currency converter function; reinforce function syntax with practical examples.
Define recursion as a function calling itself; understand the necessity of a base case to prevent infinite recursion and stack overflow.
Implement a recursive factorial function; trace the call stack to see how each recursive call returns a value to the previous layer.
Write a recursive function that returns the sum of the first n natural numbers by adding n to the sum of n-1, with a base case of 0.
Create a recursive function that prints all elements of a list by passing an index parameter and using the list length as the base case.
Understand why files are needed for persistent storage compared to volatile RAM, and learn the definition of File I/O operations.
Use the open() function with filename and mode parameters to get a file object, read its entire content with read(), and close it responsibly with close().
Read file content in chunks or line-by-line using read(size), readline(), and readlines(), and understand cursor behavior after reading.
Implement a function using readline() in a while loop to search line-by-line, returning the exact line number where a word first appears or -1 if absent.
Define classes as blueprints for creating objects, instantiate objects, and access class attributes through instances.
Implement `__init__` constructors to initialize object state, use `self` to reference the current instance, and pass dynamic data during object creation.
Differentiate between instance attributes (unique per object) and class attributes (shared across all instances), and understand attribute lookup precedence.
Create instance methods that operate on object data using `self`, including a practical example calculating average marks for a Student class.
Define static methods using `@staticmethod` for class-level functionality that does not require `self`, and understand decorators as behavior modifiers.
Explain abstraction as hiding implementation details and encapsulation as bundling data and methods together, using a car analogy.
Build a complete Student class with a parameterized constructor, instance attributes for name and marks, and a method to calculate and print average scores.
Understand how to create private attributes and methods using double underscores to restrict access to within the class only.
Grasp the concept of inheritance where a child class acquires properties and methods from a parent class, demonstrated with a Car and Toyota example.
Differentiate between multilevel inheritance (grandparent -> parent -> child) and multiple inheritance (child inheriting from two parents) with code examples.
Distinguish between static methods (utility), class methods (modify class state), and instance methods (modify object state) with practical examples.
Use the @property decorator to create dynamic attributes that automatically recalculate when underlying data changes, like a student's percentage.
Understand polymorphism as 'many forms' and see how built-in operator overloading works differently for integers, strings, and lists.
Implement custom operator overloading (__add__, __sub__) for a ComplexNumber class to add real and imaginary parts separately.
Apply inheritance by creating an Engineer subclass that inherits from Employee and uses super() to initialize parent attributes.