Complete the code to initialize the sliding window size.
window_size = [1]The sliding window size is set to 10 to process chunks of 10 elements.
Complete the code to slide the window by one position.
start = start [1] 1
Sliding the window means moving the start index forward by 1, so we add 1.
Fix the error in the code to correctly calculate the window sum.
window_sum = window_sum [1] nums[end] - nums[start - 1]
To update the sum when sliding the window, add the new element and subtract the old one. The code adds the new element and subtracts the old one outside the blank, so the blank must be '+'.
Fill both blanks to create a dictionary comprehension that maps each word to its length if length is greater than 3.
{word: [1] for word in words if [2]The dictionary comprehension maps each word to its length using len(word). The condition filters words with length greater than 3 using len(word) > 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values only if values are positive.
result = {{ [1]: [2] for k, v in data.items() if v [3] 0 }}The keys are converted to uppercase with k.upper(), values are v, and the condition filters values greater than 0 using >.