Complete the code to print the first step in a complex task plan.
print('Step 1: [1] the problem clearly.')
The first step in planning is to define the problem clearly so you know what to solve.
Complete the code to show the importance of breaking a task into smaller parts.
print('Break the task into [1] parts to make it easier.')
Breaking a task into smaller parts helps manage complexity and makes it easier to solve step by step.
Fix the error in the code that plans the order of steps.
steps = ['Define problem', 'Gather info', 'Analyze data'] plan = sorted(steps, key=lambda x: [1]) print(plan)
Sorting by x keeps the original alphabetical order of steps. Using len(x) or case changes would reorder incorrectly.
Fill both blanks to create a dictionary mapping steps to their order numbers.
plan_order = {step: [1] for [2], step in enumerate(steps)}
print(plan_order)In enumerate, the first variable is the index (here i), and the second is the step (here step). The dictionary maps each step to its index.
Fill all three blanks to filter and list steps that contain the word 'data'.
filtered_steps = [[1] for [2] in steps if '[3]' in [2]] print(filtered_steps)
The list comprehension uses step as the variable name and filters steps containing the string 'data'.