You will write a linear search, a bubble sort and a format check by hand.
Your tasks.
linear_search(items, wanted): return the position (counting from 1) of the first item equal to wanted, or 0 if it is not there.bubble_sort(items): sort a copy of the list into ascending order with a bubble sort, and return the pair (sorted_list, passes). Stop after a pass with no swaps, and count that pass too.valid_code(code): return True only for two capital letters followed by four digits, such as "AB1234".Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…