Complete the code to start the outer loop for selection sort.
for i in range([1], len(arr)): min_idx = i
The outer loop starts from index 0 to go through all elements for sorting.
Complete the code to start the inner loop for selection sort.
for j in range([1], len(arr)): if arr[j] < arr[min_idx]: min_idx = j
The inner loop starts from the next element after i to find the minimum in the unsorted part.
Fix the error in swapping the elements after finding the minimum.
arr[i], arr[[1]] = arr[[1]], arr[i]
We swap the element at i with the element at min_idx, which holds the smallest value found.
Fill both blanks to complete the condition and the key comparison in selection sort.
for i in range(len(arr)): min_idx = i for j in range(i + 1, len(arr)): if arr[j] [1] arr[min_idx]: min_idx = [2]
The condition checks if arr[j] is less than arr[min_idx], and if yes, updates min_idx to j.
Fill all three blanks to create a dictionary comprehension that maps each number to its square if the number is less than 5.
squares = [1]: [2] for [3] in range(10) if [3] < 5
The dictionary comprehension uses x as the variable, maps x to x squared, and includes only x less than 5.
