Question
>>> a={4,5,6}
>>> b={2,8,6}
>>> a-b
a.
{4,5}
b.
{6}
c.
Error as unsupported operand type for set data type
d.
Error as the duplicate item 6 is present in both sets
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of the following code?
Similar Questions
Discover Related MCQs
Q. Which of these about a frozenset is not true?
View solution
Q. Set members must not be hashable. True or False?
View solution
Q. Which of the following functions will return the symmetric difference between two sets, x and y?
View solution
Q. The ____________ function removes the first element of a set and the last element of a list.
View solution
Q. The difference between the functions discard and remove is that:
View solution
Q. If we have two sets, s1 and s2, and we want to check if all the elements of s1 are present in s2 or not, we can use the function:
View solution
Q. Set makes use of __________
Dictionary makes use of ____________
View solution
Q. Which of the following lines of code will result in an error?
View solution
Q. Input order is preserved in sets. State whether this statement is true or false.
View solution
Q. Write a list comprehension for number and its cube for:
l=[1, 2, 3, 4, 5, 6, 7, 8, 9]
View solution
Q. Which of the following functions cannot be used on heterogeneous sets?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!