pyPython Practice LabFrom first print to final round
BEGINNER → DSA → INTERVIEW READY

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.

180 guided lessons360 verified cases5 readable previews
CURRICULUM

Choose a Python topic

Follow the numbered order if you are new to coding, or open the topic you need to revise.

COMPLETE LESSON INDEX

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.

01

Python Foundations

Programs, values, variables, input(), print(), and basic type conversion.

  1. #001Echo a messageStarterFree preview
  2. #002Create a personal greetingStarterFree preview
  3. #003Add two integersStarterFree preview
02

Expressions and Data Types

Integers, floats, strings, booleans, arithmetic, comparisons, and operator precedence.

  1. #004Show basic arithmeticStarterFree preview
  2. #005Rectangle measurementsStarterFree preview
  3. #006Convert Celsius to FahrenheitStarterPremium
  4. #007Calculate a purchase totalStarterPremium
  5. #008Convert seconds to clock timeBeginnerPremium
  6. #009Swap two valuesBeginnerPremium
  7. #010Average three scoresBeginnerPremium
03

Decisions with Conditions

if, elif, else, truth values, validation, and choosing between outcomes.

  1. #011Classify even or oddStarterPremium
  2. #012Classify a number's signStarterPremium
  3. #013Find the larger of two valuesBeginnerPremium
  4. #014Find the largest of three valuesBeginnerPremium
  5. #015Detect a leap yearBeginnerPremium
  6. #016Convert a score to a gradeBeginnerPremium
  7. #017Set an age-based ticket priceIntermediatePremium
  8. #018Validate and classify a triangleIntermediatePremium
  9. #019Check a basic password policyIntermediatePremium
  10. #020Calculate a shipping feeAdvancedPremium
04

Loops and Repeated Work

for, while, counters, accumulators, ranges, and stopping conditions.

  1. #021Sum the first n integersStarterPremium
  2. #022Calculate a factorialStarterPremium
  3. #023Print a multiplication tableBeginnerPremium
  4. #024Count digits in an integerBeginnerPremium
  5. #025Reverse an integerBeginnerPremium
  6. #026Check a numeric palindromeBeginnerPremium
  7. #027Test primalityIntermediatePremium
  8. #028List primes up to nIntermediatePremium
  9. #029Generate Fibonacci termsIntermediatePremium
  10. #030Find GCD and LCMAdvancedPremium
05

Functions and Program Design

Parameters, return values, default and keyword arguments, scope, decomposition, and reusable code.

  1. #031Reuse a prime-checking functionStarterPremium
  2. #032Calculate tax with an optional rateStarterPremium
  3. #033Average any number of valuesBeginnerPremium
  4. #034Create a discount closureBeginnerPremium
  5. #035Generate a countdownBeginnerPremium
  6. #036Log a function call with a decoratorBeginnerPremium
06

Strings and Text Processing

Indexing, slicing, searching, formatting, normalization, and character-by-character logic.

  1. #037Reverse textStarterPremium
  2. #038Check a phrase palindromeStarterPremium
  3. #039Count vowels and consonantsBeginnerPremium
  4. #040Count wordsBeginnerPremium
  5. #041Count a chosen characterBeginnerPremium
  6. #042Remove duplicate charactersBeginnerPremium
  7. #043Check for anagramsIntermediatePremium
  8. #044Find the first nonrepeating characterIntermediatePremium
  9. #045Run-length encode textIntermediatePremium
  10. #046Find the longest wordAdvancedPremium
07

Lists, Tuples, and Nested Data

Ordered collections, mutation, traversal, copying, matrices, and sequence reasoning.

  1. #047Calculate list sum and averageStarterPremium
  2. #048Find largest and second largestStarterPremium
  3. #049Remove list duplicates in orderBeginnerPremium
  4. #050Rotate a list to the rightBeginnerPremium
  5. #051Move zeros to the endBeginnerPremium
  6. #052Merge two sorted listsBeginnerPremium
  7. #053Find a missing numberIntermediatePremium
  8. #054Find two-sum indexesIntermediatePremium
  9. #055Find the maximum subarray sumIntermediatePremium
  10. #056Transpose a matrixAdvancedPremium
08

Sets and Dictionaries

Uniqueness, membership tests, key-value lookup, frequency counting, and grouping.

  1. #057Calculate set union and intersectionStarterPremium
  2. #058Count unique wordsStarterPremium
  3. #059Build a word-frequency tableBeginnerPremium
  4. #060Calculate a student's averageBeginnerPremium
  5. #061Update inventoryBeginnerPremium
  6. #062Group anagramsBeginnerPremium
  7. #063Invert a dictionaryIntermediatePremium
  8. #064Find the top k frequent valuesIntermediatePremium
  9. #065Merge numeric dictionariesIntermediatePremium
  10. #066Build an adjacency listAdvancedPremium
09

Files, Exceptions, and Modules

Reading and writing text data, handling predictable failures, imports, and safe input boundaries.

  1. #067Count lines, words, and charactersStarterPremium
  2. #068Total values from CSV rowsStarterPremium
  3. #069Extract error log entriesBeginnerPremium
  4. #070Replace a word in textBeginnerPremium
  5. #071Divide safely with exceptionsBeginnerPremium
  6. #072Validate integer inputBeginnerPremium
  7. #073Parse key-value configurationIntermediatePremium
  8. #074Summarize JSON ordersIntermediatePremium
  9. #075Calculate days between datesIntermediatePremium
  10. #076Count file extensionsAdvancedPremium
10

Classes and Object-Oriented Python

Objects, attributes, methods, constructors, composition, and basic inheritance.

  1. #077Model a rectangle classStarterPremium
  2. #078Model a bank accountStarterPremium
  3. #079Model a student gradeBeginnerPremium
  4. #080Build a shopping cartBeginnerPremium
  5. #081Use inheritance for employeesBeginnerPremium
  6. #082Protect temperature with a propertyBeginnerPremium
  7. #083Customize book display and equalityIntermediatePremium
  8. #084Use a dataclass for inventoryIntermediatePremium
  9. #085Model compositionIntermediatePremium
11

Comprehensions, Iteration, and Pythonic Data Work

Comprehensions, enumerate, zip, sorting keys, lambda, map/filter, and readable transformations.

  1. #086Sort records with a lambdaBeginnerPremium
  2. #087Square values with mapIntermediatePremium
  3. #088Filter passing scoresIntermediatePremium
  4. #089Multiply values with reduceIntermediatePremium
  5. #090Create a countdown iteratorAdvancedPremium
12

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.

  1. #091Perform linear searchBeginnerPremium
  2. #092Perform iterative binary searchIntermediatePremium
  3. #093Find first and last occurrenceIntermediatePremium
  4. #094Sort with bubble sortIntermediatePremium
  5. #095Sort with insertion sortAdvancedPremium
  6. #096Merge overlapping intervalsAdvancedPremium
  7. #097Build product except selfAdvancedPremium
  8. #098Find the majority elementInterview-LevelPremium
  9. #099Find longest substring without repeatsInterview-LevelPremium
  10. #100Maximize one stock transactionInterview-LevelPremium
  11. #101Find unique three-sum tripletsInterview-LevelPremium
  12. #102Maximize water between linesInterview-LevelPremium
  13. #103Calculate trapped rain waterInterview-LevelPremium
  14. #104Find the longest consecutive runInterview-LevelPremium
  15. #105Rotate a square matrix clockwiseInterview-LevelPremium
  16. #106Read a matrix in spiral orderInterview-LevelPremium
  17. #107Set matrix rows and columns to zeroInterview-LevelPremium
  18. #108Count subarrays with target sumInterview-LevelPremium
  19. #109Find the minimum covering windowInterview-LevelPremium
13

Recursion and Backtracking

Base cases, call stacks, recursive structure, choice trees, pruning, and undoing choices safely.

  1. #110Compute factorial recursivelyBeginnerPremium
  2. #111Sum digits recursivelyIntermediatePremium
  3. #112Calculate integer power recursivelyIntermediatePremium
  4. #113Find GCD recursivelyIntermediatePremium
  5. #114Binary search recursivelyAdvancedPremium
  6. #115Check a palindrome recursivelyAdvancedPremium
  7. #116Generate all permutationsAdvancedPremium
  8. #117Generate all subsetsInterview-LevelPremium
  9. #118Generate balanced parenthesesInterview-LevelPremium
  10. #119Count N-Queens solutionsInterview-LevelPremium
  11. #120Sort with merge sortInterview-LevelPremium
  12. #121Sort with quicksortInterview-LevelPremium
14

Core Data Structures: Stacks, Queues, Linked Lists, Heaps, and Intervals

Choosing structures by operations, monotonic reasoning, priority queues, and interval processing.

  1. #122Validate brackets with a stackBeginnerPremium
  2. #123Implement a queue with two stacksIntermediatePremium
  3. #124Reverse a linked listIntermediatePremium
  4. #125Find the middle linked-list nodeIntermediatePremium
  5. #126Detect a linked-list cycleAdvancedPremium
  6. #127Merge k sorted listsAdvancedPremium
  7. #128Add numbers stored in linked listsAdvancedPremium
  8. #129Copy a random-pointer listInterview-LevelPremium
  9. #130Reorder a linked listInterview-LevelPremium
  10. #131Implement an LRU cacheInterview-LevelPremium
  11. #132Implement a minimum stackInterview-LevelPremium
  12. #133Find warmer-day waitsInterview-LevelPremium
  13. #134Find the largest histogram rectangleInterview-LevelPremium
  14. #135Find sliding-window maximumsInterview-LevelPremium
  15. #136Count required meeting roomsInterview-LevelPremium
15

Trees and Tries

Traversal, recursion on hierarchies, binary-search-tree rules, prefix lookup, and subtree reasoning.

  1. #137Traverse a binary tree by levelsBeginnerPremium
  2. #138Find binary-tree maximum depthIntermediatePremium
  3. #139Validate a binary search treeIntermediatePremium
  4. #140Find lowest common ancestorIntermediatePremium
  5. #141Find kth smallest value in a BSTAdvancedPremium
  6. #142Serialize and deserialize a binary treeAdvancedPremium
  7. #143Build a tree from preorder and inorderAdvancedPremium
  8. #144View a binary tree from the rightInterview-LevelPremium
  9. #145Calculate binary-tree diameterInterview-LevelPremium
  10. #146List root-to-leaf target pathsInterview-LevelPremium
  11. #147Implement a prefix trieInterview-LevelPremium
  12. #148Find dictionary words in a boardInterview-LevelPremium
  13. #149Find maximum binary-tree path sumInterview-LevelPremium
16

Graphs and Connectivity

Graph representation, BFS, DFS, shortest paths, topological order, and union-find.

  1. #150Traverse a graph with BFSBeginnerPremium
  2. #151Find an unweighted shortest pathIntermediatePremium
  3. #152Count islands in a gridIntermediatePremium
  4. #153Topologically sort tasksIntermediatePremium
  5. #154Count connected components with union-findAdvancedPremium
  6. #155Find a redundant graph edgeAdvancedPremium
  7. #156Check if courses can be completedAdvancedPremium
  8. #157Clone an undirected graphInterview-LevelPremium
  9. #158Merge accounts by shared emailInterview-LevelPremium
  10. #159Find a word-ladder lengthInterview-LevelPremium
  11. #160Evaluate division queriesInterview-LevelPremium
  12. #161Find network delay timeInterview-LevelPremium
  13. #162Find cheapest flight with stop limitInterview-LevelPremium
  14. #163Infer an alien alphabetInterview-LevelPremium
17

Dynamic Programming

State design, recurrences, memoization, tabulation, optimization, and overlapping subproblems.

  1. #164Count ways to climb stairsBeginnerPremium
  2. #165Maximize nonadjacent house lootIntermediatePremium
  3. #166Find minimum coinsIntermediatePremium
  4. #167Solve 0/1 knapsackIntermediatePremium
  5. #168Find longest increasing subsequence lengthAdvancedPremium
  6. #169Find longest common subsequence lengthAdvancedPremium
  7. #170Calculate edit distanceAdvancedPremium
  8. #171Partition values into equal sumsInterview-LevelPremium
  9. #172Segment a string into dictionary wordsInterview-LevelPremium
  10. #173Count numeric message decodingsInterview-LevelPremium
  11. #174Count unique paths with obstaclesInterview-LevelPremium
18

Interview Pattern Synthesis

Greedy proof, bit manipulation, and mixed-pattern practice that combines earlier techniques.

  1. #175Decide if the last array index is reachableBeginnerPremium
  2. #176Find a valid gas-station startIntermediatePremium
  3. #177Generate target-sum combinationsIntermediatePremium
  4. #178Search a word in a character boardIntermediatePremium
  5. #179Validate a Sudoku boardAdvancedPremium
  6. #180Find the single value with XORAdvancedPremium