about | help | code help+videos | done | prefs |
Write a function swap(data, i, j) that swaps the positions of the items with indices i and j in the list named data. Once you've created the list L with those entries swapped, finish the function by returning L. swap_better([1, 2, 3, 4, 5], 1, 3) → [1, 4, 3, 2, 5] swap_better([[1], 2, [3], 4, 5], 1, 1) → [[1], 2, [3], 4, 5] swap_better(['yet', 'another', 'coding', 'bat', 'test'], 0, 4) → ['test', 'another', 'coding', 'bat', 'yet'] ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy