pyPython Practice LabFrom first print to final round
TOPIC 07 OF 18

Lists, Tuples, and Nested Data Python practice problems

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

20 exercises8+ conceptsBeginner → interview context
Start this topic
WHAT YOU WILL PRACTISE

Core concepts

Calculate list sum and averageFind largest and second largestRemove list duplicates in orderRotate a list to the rightMove zeros to the endMerge two sorted listsFind a missing numberFind two-sum indexes
REUSABLE THINKING

Problem-solving patterns

  • list · aggregate
  • set · sorting
  • deduplication · order
  • slicing · modulo
  • comprehension · stable order
PRACTICE OUTCOME

What this topic builds

Learn the idea once, use it across the exercises, and explain why your approach works.

ORDERED PRACTICE

All 20 problems in this topic

Work from top to bottom to build the concept gradually.

  1. #093
    Calculate list sum and average: Daily sales

    Summarize several daily sales values.

    StarterPremium
  2. #094
    Calculate list sum and average: Decimal measurements

    Average measurements that contain decimals and a negative correction.

    StarterPremium
  3. #095
    Find largest and second largest: Contest scores

    Report the highest and second-highest distinct contest scores.

    StarterPremium
  4. #096
    Find largest and second largest: Negative values

    Find the two greatest distinct values in an all-negative list.

    StarterPremium
  5. #097
    Remove list duplicates in order: Clean survey codes

    Remove repeated response codes without rearranging the first occurrences.

    BeginnerPremium
  6. #098
    Remove list duplicates in order: Already unique

    Confirm that an already unique list is unchanged.

    BeginnerPremium
  7. #099
    Rotate a list to the right: Shift duty roster

    Rotate a five-person roster two positions to the right.

    BeginnerPremium
  8. #100
    Rotate a list to the right: Rotation larger than length

    Use modulo when the requested rotation exceeds the list length.

    BeginnerPremium
  9. #101
    Move zeros to the end: Clean sparse readings

    Move missing-value markers to the end while keeping other readings in order.

    BeginnerPremium
  10. #102
    Move zeros to the end: No zeros

    Confirm that a dense list remains unchanged.

    BeginnerPremium
  11. #103
    Merge two sorted lists: Merge rank lists

    Combine two sorted rank lists into one sorted report.

    BeginnerPremium
  12. #104
    Merge two sorted lists: Duplicates across lists

    Keep all occurrences when equal values appear in both inputs.

    IntermediatePremium
  13. #105
    Find a missing number: Missing attendance ID

    Find the absent ID among a consecutive class roster.

    IntermediatePremium
  14. #106
    Find a missing number: Missing boundary

    Find the missing final value rather than a value in the middle.

    IntermediatePremium
  15. #107
    Find two-sum indexes: Price pair

    Find zero-based indexes of two prices that exactly use a gift voucher.

    IntermediatePremium
  16. #108
    Find two-sum indexes: Pair containing a negative

    Find a target pair when one list value is negative.

    IntermediatePremium
  17. #109
    Find the maximum subarray sum: Best profit streak

    Find the largest total across a consecutive streak of daily gains and losses.

    IntermediatePremium
  18. #110
    Find the maximum subarray sum: All losses

    Return the least negative single day when every value is negative.

    AdvancedPremium
  19. #111
    Transpose a matrix: Rectangular table

    Turn a 2-by-3 table into a 3-by-2 table.

    AdvancedPremium
  20. #112
    Transpose a matrix: Single row

    Transpose a one-row matrix into a one-column result.

    AdvancedPremium