Module 3
Data Structures
// Lessons
6
// Quiz questions
90
// Reading time
90 min
// Exam length
15 Q
// Coding exercises
10
- 1Lists & Indexing OperationsCreate ordered mutable sequences, access sub-ranges via slicing, and manage element mutations. 15 min 15 questions
- 2List Algorithms & Memory ModelsCompare in-place sorting vs sorted(), implement custom keys, and avoid shallow copying bugs. 15 min 15 questions
- 3Tuples & Sequence UnpackingProtect data integrity with immutable records, single-item syntax, and structural unpacking. 15 min 15 questions
- 4Strings & Text RepresentationUnderstand unicode character indexing, slice extraction, and memory immutability constraints. 15 min 15 questions
- 5String Methods & Text SanitizationClean and transform raw text data using casing transformations, whitespace trimming, and split-join pipelines. 15 min 15 questions
- 6List ComprehensionsTransform collections with concise, idiomatic inline mapping, filtering, and nested iterations. 15 min 15 questions
Coding practice: write it yourself
Real Python, real checks: write your answer, press Run checks, and keep going until it passes. (4 exercises)
Coding practice needs an account. Sign in or create a free ID to run these exercises.
Lab 1: Shopping basket
Starting from ["rice", "oil"], append "dates", then print the whole list followed by its length on one line — like ['rice', 'oil', 'dates'] 3.
Coding Practice is Locked
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.
Lab 2: Top score
Cricket scores: [88, 101, 45]. Print the highest score without sorting the list manually — there is a built-in for that.
Coding Practice is Locked
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.
Lab 3: Unique visitors
The log ["Mim", "Rafi", "Mim"] has repeats. Print how many UNIQUE visitors there are.
Coding Practice is Locked
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.
Lab 4: Safe marks lookup
With marks = {"Mim": 78}, print Mim's marks AND Rafi's using .get() with default 0 — expecting 78 0.
Coding Practice is Locked
Sign in to access the interactive Python editor, write and run code checks against automated tests, use hints, and earn XP.
References & Further Reading
Related entries from PyLabs's own reference library.