Question: Your autotest cases will NOT work if you don't load your sys.argv like below. For this assignment, load in your variables like this: set_a =
Your autotest cases will NOT work if you don't load your sys.argv like below. For this assignment, load in your variables like this: set_a = sys.argv[1:] set_b = ['apple', 'banana', 'mango', 'orange'] The above set_a is a list-type variable which contains words. Your order may be different for the examples below because sets are unordered. Build a program, commonset.py. Your program should: Find the common words between set_a and set_b. Print the output in a set format. Example 1 - If the set_a is ['apple', 'banana', 'pear', 'grape'], the program should print: {'banana', 'apple'} Example 2 - If the set_a is ['mango', 'mango', 'mango', 'pear', 'grape'], the program should print: {'mango'} Use sys.argv to test, no input() allowed and no additional library's need to be imported
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
