180 Python lessons in one clear learning order
Build Python skill through scenario-based lessons instead of random questions. Every lesson includes two verified cases, beginning with input and output before progressing through functions, OOP, data structures, algorithms and interview patterns.
Choose a Python topic
Follow the numbered order if you are new to coding, or open the topic you need to revise.
Learn by topic and difficulty
The first five pages include readable lesson details, two verified cases and solutions. Premium pages explain the skill being tested before asking you to unlock the complete workspace.
Python Foundations
Programs, values, variables, input(), print(), and basic type conversion.
Expressions and Data Types
Integers, floats, strings, booleans, arithmetic, comparisons, and operator precedence.
- #004Show basic arithmeticStarterFree preview
- #005Rectangle measurementsStarterFree preview
- #006Convert Celsius to FahrenheitStarterPremium
- #007Calculate a purchase totalStarterPremium
- #008Convert seconds to clock timeBeginnerPremium
- #009Swap two valuesBeginnerPremium
- #010Average three scoresBeginnerPremium
Decisions with Conditions
if, elif, else, truth values, validation, and choosing between outcomes.
- #011Classify even or oddStarterPremium
- #012Classify a number's signStarterPremium
- #013Find the larger of two valuesBeginnerPremium
- #014Find the largest of three valuesBeginnerPremium
- #015Detect a leap yearBeginnerPremium
- #016Convert a score to a gradeBeginnerPremium
- #017Set an age-based ticket priceIntermediatePremium
- #018Validate and classify a triangleIntermediatePremium
- #019Check a basic password policyIntermediatePremium
- #020Calculate a shipping feeAdvancedPremium
Loops and Repeated Work
for, while, counters, accumulators, ranges, and stopping conditions.
- #021Sum the first n integersStarterPremium
- #022Calculate a factorialStarterPremium
- #023Print a multiplication tableBeginnerPremium
- #024Count digits in an integerBeginnerPremium
- #025Reverse an integerBeginnerPremium
- #026Check a numeric palindromeBeginnerPremium
- #027Test primalityIntermediatePremium
- #028List primes up to nIntermediatePremium
- #029Generate Fibonacci termsIntermediatePremium
- #030Find GCD and LCMAdvancedPremium
Functions and Program Design
Parameters, return values, default and keyword arguments, scope, decomposition, and reusable code.
Strings and Text Processing
Indexing, slicing, searching, formatting, normalization, and character-by-character logic.
- #037Reverse textStarterPremium
- #038Check a phrase palindromeStarterPremium
- #039Count vowels and consonantsBeginnerPremium
- #040Count wordsBeginnerPremium
- #041Count a chosen characterBeginnerPremium
- #042Remove duplicate charactersBeginnerPremium
- #043Check for anagramsIntermediatePremium
- #044Find the first nonrepeating characterIntermediatePremium
- #045Run-length encode textIntermediatePremium
- #046Find the longest wordAdvancedPremium
Lists, Tuples, and Nested Data
Ordered collections, mutation, traversal, copying, matrices, and sequence reasoning.
- #047Calculate list sum and averageStarterPremium
- #048Find largest and second largestStarterPremium
- #049Remove list duplicates in orderBeginnerPremium
- #050Rotate a list to the rightBeginnerPremium
- #051Move zeros to the endBeginnerPremium
- #052Merge two sorted listsBeginnerPremium
- #053Find a missing numberIntermediatePremium
- #054Find two-sum indexesIntermediatePremium
- #055Find the maximum subarray sumIntermediatePremium
- #056Transpose a matrixAdvancedPremium
Sets and Dictionaries
Uniqueness, membership tests, key-value lookup, frequency counting, and grouping.
- #057Calculate set union and intersectionStarterPremium
- #058Count unique wordsStarterPremium
- #059Build a word-frequency tableBeginnerPremium
- #060Calculate a student's averageBeginnerPremium
- #061Update inventoryBeginnerPremium
- #062Group anagramsBeginnerPremium
- #063Invert a dictionaryIntermediatePremium
- #064Find the top k frequent valuesIntermediatePremium
- #065Merge numeric dictionariesIntermediatePremium
- #066Build an adjacency listAdvancedPremium
Files, Exceptions, and Modules
Reading and writing text data, handling predictable failures, imports, and safe input boundaries.
- #067Count lines, words, and charactersStarterPremium
- #068Total values from CSV rowsStarterPremium
- #069Extract error log entriesBeginnerPremium
- #070Replace a word in textBeginnerPremium
- #071Divide safely with exceptionsBeginnerPremium
- #072Validate integer inputBeginnerPremium
- #073Parse key-value configurationIntermediatePremium
- #074Summarize JSON ordersIntermediatePremium
- #075Calculate days between datesIntermediatePremium
- #076Count file extensionsAdvancedPremium
Classes and Object-Oriented Python
Objects, attributes, methods, constructors, composition, and basic inheritance.
- #077Model a rectangle classStarterPremium
- #078Model a bank accountStarterPremium
- #079Model a student gradeBeginnerPremium
- #080Build a shopping cartBeginnerPremium
- #081Use inheritance for employeesBeginnerPremium
- #082Protect temperature with a propertyBeginnerPremium
- #083Customize book display and equalityIntermediatePremium
- #084Use a dataclass for inventoryIntermediatePremium
- #085Model compositionIntermediatePremium
Comprehensions, Iteration, and Pythonic Data Work
Comprehensions, enumerate, zip, sorting keys, lambda, map/filter, and readable transformations.
Algorithm Foundations: Arrays, Searching, Sorting, and Hashing
Complexity, linear and binary search, sorted() trade-offs, prefix ideas, two pointers, sliding windows, and hash-map patterns.
- #091Perform linear searchBeginnerPremium
- #092Perform iterative binary searchIntermediatePremium
- #093Find first and last occurrenceIntermediatePremium
- #094Sort with bubble sortIntermediatePremium
- #095Sort with insertion sortAdvancedPremium
- #096Merge overlapping intervalsAdvancedPremium
- #097Build product except selfAdvancedPremium
- #098Find the majority elementInterview-LevelPremium
- #099Find longest substring without repeatsInterview-LevelPremium
- #100Maximize one stock transactionInterview-LevelPremium
- #101Find unique three-sum tripletsInterview-LevelPremium
- #102Maximize water between linesInterview-LevelPremium
- #103Calculate trapped rain waterInterview-LevelPremium
- #104Find the longest consecutive runInterview-LevelPremium
- #105Rotate a square matrix clockwiseInterview-LevelPremium
- #106Read a matrix in spiral orderInterview-LevelPremium
- #107Set matrix rows and columns to zeroInterview-LevelPremium
- #108Count subarrays with target sumInterview-LevelPremium
- #109Find the minimum covering windowInterview-LevelPremium
Recursion and Backtracking
Base cases, call stacks, recursive structure, choice trees, pruning, and undoing choices safely.
- #110Compute factorial recursivelyBeginnerPremium
- #111Sum digits recursivelyIntermediatePremium
- #112Calculate integer power recursivelyIntermediatePremium
- #113Find GCD recursivelyIntermediatePremium
- #114Binary search recursivelyAdvancedPremium
- #115Check a palindrome recursivelyAdvancedPremium
- #116Generate all permutationsAdvancedPremium
- #117Generate all subsetsInterview-LevelPremium
- #118Generate balanced parenthesesInterview-LevelPremium
- #119Count N-Queens solutionsInterview-LevelPremium
- #120Sort with merge sortInterview-LevelPremium
- #121Sort with quicksortInterview-LevelPremium
Core Data Structures: Stacks, Queues, Linked Lists, Heaps, and Intervals
Choosing structures by operations, monotonic reasoning, priority queues, and interval processing.
- #122Validate brackets with a stackBeginnerPremium
- #123Implement a queue with two stacksIntermediatePremium
- #124Reverse a linked listIntermediatePremium
- #125Find the middle linked-list nodeIntermediatePremium
- #126Detect a linked-list cycleAdvancedPremium
- #127Merge k sorted listsAdvancedPremium
- #128Add numbers stored in linked listsAdvancedPremium
- #129Copy a random-pointer listInterview-LevelPremium
- #130Reorder a linked listInterview-LevelPremium
- #131Implement an LRU cacheInterview-LevelPremium
- #132Implement a minimum stackInterview-LevelPremium
- #133Find warmer-day waitsInterview-LevelPremium
- #134Find the largest histogram rectangleInterview-LevelPremium
- #135Find sliding-window maximumsInterview-LevelPremium
- #136Count required meeting roomsInterview-LevelPremium
Trees and Tries
Traversal, recursion on hierarchies, binary-search-tree rules, prefix lookup, and subtree reasoning.
- #137Traverse a binary tree by levelsBeginnerPremium
- #138Find binary-tree maximum depthIntermediatePremium
- #139Validate a binary search treeIntermediatePremium
- #140Find lowest common ancestorIntermediatePremium
- #141Find kth smallest value in a BSTAdvancedPremium
- #142Serialize and deserialize a binary treeAdvancedPremium
- #143Build a tree from preorder and inorderAdvancedPremium
- #144View a binary tree from the rightInterview-LevelPremium
- #145Calculate binary-tree diameterInterview-LevelPremium
- #146List root-to-leaf target pathsInterview-LevelPremium
- #147Implement a prefix trieInterview-LevelPremium
- #148Find dictionary words in a boardInterview-LevelPremium
- #149Find maximum binary-tree path sumInterview-LevelPremium
Graphs and Connectivity
Graph representation, BFS, DFS, shortest paths, topological order, and union-find.
- #150Traverse a graph with BFSBeginnerPremium
- #151Find an unweighted shortest pathIntermediatePremium
- #152Count islands in a gridIntermediatePremium
- #153Topologically sort tasksIntermediatePremium
- #154Count connected components with union-findAdvancedPremium
- #155Find a redundant graph edgeAdvancedPremium
- #156Check if courses can be completedAdvancedPremium
- #157Clone an undirected graphInterview-LevelPremium
- #158Merge accounts by shared emailInterview-LevelPremium
- #159Find a word-ladder lengthInterview-LevelPremium
- #160Evaluate division queriesInterview-LevelPremium
- #161Find network delay timeInterview-LevelPremium
- #162Find cheapest flight with stop limitInterview-LevelPremium
- #163Infer an alien alphabetInterview-LevelPremium
Dynamic Programming
State design, recurrences, memoization, tabulation, optimization, and overlapping subproblems.
- #164Count ways to climb stairsBeginnerPremium
- #165Maximize nonadjacent house lootIntermediatePremium
- #166Find minimum coinsIntermediatePremium
- #167Solve 0/1 knapsackIntermediatePremium
- #168Find longest increasing subsequence lengthAdvancedPremium
- #169Find longest common subsequence lengthAdvancedPremium
- #170Calculate edit distanceAdvancedPremium
- #171Partition values into equal sumsInterview-LevelPremium
- #172Segment a string into dictionary wordsInterview-LevelPremium
- #173Count numeric message decodingsInterview-LevelPremium
- #174Count unique paths with obstaclesInterview-LevelPremium
Interview Pattern Synthesis
Greedy proof, bit manipulation, and mixed-pattern practice that combines earlier techniques.
- #175Decide if the last array index is reachableBeginnerPremium
- #176Find a valid gas-station startIntermediatePremium
- #177Generate target-sum combinationsIntermediatePremium
- #178Search a word in a character boardIntermediatePremium
- #179Validate a Sudoku boardAdvancedPremium
- #180Find the single value with XORAdvancedPremium