Question: set _ a = sys . argv [ 1 : ] set _ b = [ ' apple ' , 'banana', 'mango', 'orange' ] The

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.
Create 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:

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!