Put the lesson Sets into practice by writing a program yourself.
Two steel samples were analysed for the elements they contain. Use set operations to compare them.
Sets have no order, so wrap results in sorted() to print them alphabetically.
In both: ['C', 'Fe'] Only in steel A: ['Cr', 'Ni'] Different elements in total: 5
Write your program below and press Run. Each run is checked against the expected output.
Press Run to see what your program prints.
One possible solution. Other programs that print the same output are correct too.
steel_a = {"Fe", "C", "Cr", "Ni"}steel_b = {"Fe", "C", "Mn"}print("In both:", sorted(steel_a & steel_b))print("Only in steel A:", sorted(steel_a - steel_b))print("Different elements in total:", len(steel_a | steel_b))