Editor

Python list exercises

Python list problems, from indexing and slicing to comprehensions and in-place changes, each checked by tests in your browser.

Beginner

  1. 9. Count ElementHow many times does it appear?40 XP4 min
  2. 11. Sum of ListAdd up a list the long way40 XP4 min
  3. 13. Find MaximumThe largest value, found by hand45 XP5 min
  4. 14. Reverse a ListBack to front45 XP5 min
  5. 26. Flatten One LevelBoxes inside a box: tip them all out onto the table25 XP4 min
  6. 39. The Missing NumberEvery number from zero upwards is here, except one35 XP5 min
  7. 205. Running TotalHow does the balance look after each payment?25 XP4 min
  8. 209. Above AverageWhich days beat the monthly average?30 XP5 min
  9. 212. Chunk a ListSix eggs to a box: how do the boxes fill up?30 XP5 min
  10. 243. Second Largest ValueWho takes the silver medal when ties share the gold?35 XP6 min

Intermediate

  1. 18. Remove DuplicatesEvery item once, order kept60 XP7 min
  2. 55. Rotate a ListSpin the list around without losing anyone55 XP8 min
  3. 78. Common to Every ListWhat do all the shopping lists have in common?70 XP14 min
  4. 97. Rotate the GridTurn a square picture a quarter turn to the right75 XP12 min
  5. 107. Merge Overlapping IntervalsOverlapping bookings melt into one long block85 XP15 min
  6. 114. Product of All the OthersEvery number, multiplied by everyone except itself90 XP15 min
  7. 275. Row of Pascal's TriangleA famous triangle of numbers, one row at a time60 XP10 min

Advanced

  1. 121. Insert an IntervalA new booking lands in an already busy calendar115 XP20 min
  2. 122. Many Range UpdatesThousands of edits to a long list, and only the final result matters115 XP18 min
  3. 153. Balanced Zeros and OnesThe longest stretch where zeros and ones are perfectly even140 XP25 min
  4. 168. Make the Sum DivisibleCut out the shortest stretch so the total divides evenly165 XP30 min

Expert

  1. 196. Rectangles That Sum to TargetHow many blocks of the grid add up to exactly the target?260 XP50 min

Other topics

Or see every challenge, with study plans, today's challenge and duels.