πŸ“Š Python
Q. Suppose there are two sets, set1 and set2,where set1 is the superset of set2. It is required to get only the unique elements of both the sets. Which of the following will serve the purpose?
Code:
set1={2,3}

set2={3,2}

set3={2,1}

if(set1==set2):

    print("yes")

else:

    print("no")

if(set1==set3):

    print("yes")

else:

    print("no")
  • (A) set1|set2
  • (B) set1&set2
  • (C) set1-set2
  • (D) None of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) set1-set2

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
237
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
90%
Success Rate