Skip to content

Sorting

Handout

Putting items in order

  • Sorting arranges a list into order, usually smallest first.
  • The key move is a swap: exchange two items.
  • In Python: a[i], a[j] = a[j], a[i] swaps two list items in one line.

Handout

Log in or create account

IGCSE & A-Level