Guide
Python
Beginner
Sets: Chapter Practice
Apply sets with a mini lab and knowledge check.
Mini lab
Find required tags absent from an observed tag set.
Expected output: [‘Owner’]
Hint
Use the chapter examples to choose the operation, then run your version before opening the solution.Show solution
required = {"Name", "Owner", "Environment"}
observed = {"Name", "Environment"}
print(sorted(required - observed))
Knowledge check
Why sort the result for a report?
Check your answer
Sets do not guarantee iteration order. Sorting gives deterministic report output.Finish the chapter
- Explain each operation without reading the lesson.
- Change the sample input and predict the output before running it.
- Revisit the chapter if the result differs from your prediction.
Add More Questions to This Guide
Know a question that should be here? Share it and help the community!
Open Google Form