Question: Write all your functions in the following parts in python. In each part, make sure that the names of your functions match the names of
Write all your functions in the following parts in python. In each part, make sure that the names of your functions match the names of the functions that we are asking you to write. There are two sets of test cases. The autograder on Gradescope will only reveal the results of one set of cases. You will not know the results of the other set of test cases. This is done to encourage you to test your own code. Note: Place all the functions in a single python file and make sure to name your python file ps4.py for the auto-grader to recognize and compile the file. Also, do not include any print statements or header documentation in the file.
a) Write a function subset(A, B) that takes two sets, and outputs if the first set is a subset of the second set.
b) Write a function sd(A, B) that takes two sets A and B, and outputs their symmetric difference A B. Hint: You may need to read the following page about sets in W3Schools: https://www.w3schools. com/python/python_sets.asp
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
