Comparing the tags of two posts

Write code · Medium · §4.5 Set operations and set()

a and b are the sets of tags on two posts. Sort the tags they share, the tags only in a, and the tags only in b with sorted(), and print them in that order. On the last line, print the number of different tags across both posts.

Starter code

a = {"python", "survey", "news"}
b = {"news", "ai", "survey"}

Solve this problem in your browser

Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.