Lists, Tuples, and Matrices Python practice problems
Use sequence operations and common array patterns, then move into matrix processing.
Core concepts
Problem-solving patterns
- Choose an index or value traversal, then update the collection
Reported company tags
All 20 problems in this topic
Work from top to bottom to build the concept gradually.
- #081Calculate list sum and average: Daily salesBeginnerPremium
Summarize several daily sales values.
- #082Calculate list sum and average: Decimal measurementsBeginnerPremium
Average measurements that contain decimals and a negative correction.
- #083Find largest and second largest: Contest scoresBeginnerPremium
Report the highest and second-highest distinct contest scores.
- #084Find largest and second largest: Negative valuesBeginnerPremium
Find the two greatest distinct values in an all-negative list.
- #085Remove list duplicates in order: Clean survey codesBeginnerPremium
Remove repeated response codes without rearranging the first occurrences.
- #086Remove list duplicates in order: Already uniqueBeginnerPremium
Confirm that an already unique list is unchanged.
- #087Rotate a list to the right: Shift duty rosterBeginnerPremium
Rotate a five-person roster two positions to the right.
- #088Rotate a list to the right: Rotation larger than lengthBeginnerPremium
Use modulo when the requested rotation exceeds the list length.
- #089Move zeros to the end: Clean sparse readingsBeginnerPremium
Move missing-value markers to the end while keeping other readings in order.
- #090Move zeros to the end: No zerosBeginnerPremium
Confirm that a dense list remains unchanged.
- #091Merge two sorted lists: Merge rank listsBeginnerPremium
Combine two sorted rank lists into one sorted report.
- #092Merge two sorted lists: Duplicates across listsBeginnerPremium
Keep all occurrences when equal values appear in both inputs.
- #093Find a missing number: Missing attendance IDBeginnerPremium
Find the absent ID among a consecutive class roster.
- #094Find a missing number: Missing boundaryBeginnerPremium
Find the missing final value rather than a value in the middle.
- #095Find two-sum indexes: Price pairBeginnerPremium
Find zero-based indexes of two prices that exactly use a gift voucher.
- #096Find two-sum indexes: Pair containing a negativeBeginnerPremium
Find a target pair when one list value is negative.
- #097Find the maximum subarray sum: Best profit streakBeginnerPremium
Find the largest total across a consecutive streak of daily gains and losses.
- #098Find the maximum subarray sum: All lossesBeginnerPremium
Return the least negative single day when every value is negative.
- #099Transpose a matrix: Rectangular tableBeginnerPremium
Turn a 2-by-3 table into a 3-by-2 table.
- #100Transpose a matrix: Single rowBeginnerPremium
Transpose a one-row matrix into a one-column result.