# What will be the output of the following Python code >>> a={4,5,6} >>> b={2,8,6} >>> a+b

1.  {4,5,6,2,8}

2.  {4,5,6,2,8,6}

3.  Error as unsupported operand type for sets

4.  Error as the duplicate item 6 is present in both sets

4

Error as unsupported operand type for sets

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a={4,5,6} >>> b={2,8,6} >>> a-b

1.  {4,5}

2.  {6}

3.  Error as unsupported operand type for set data type

4.  Error as the duplicate item 6 is present in both sets

4

{4,5}

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a={5,6,7,8} >>> b={7,8,10,11} >>> a^b

1.  {5,6,7,8,10,11}

2.  {7,8}

3.  Error as unsupported operand type of set data type

4.  {5,6,10,11}

4

{5,6,10,11}

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> s={5,6} >>> s*3

1.  Error as unsupported operand type for set data type

2.  {5,6,5,6,5,6}

3.  {5,6}

4.  Error as multiplication creates duplicate elements which isn’t allowed

4

Error as unsupported operand type for set data type

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a={5,6,7,8} >>> b={7,5,6,8} >>> a==b

1.  True

2.  False

2

True

Explanation :
No Explanation available for this question

# What will be the output of the following Python code >>> a={3,4,5} >>> b={5,6,7} >>> a|b

1.  Invalid operation

2.  {3, 4, 5, 6, 7}

3.  {5}

4.  {3,4,6,7}

4

{3, 4, 5, 6, 7}

Explanation :
No Explanation available for this question

# Is the following Python code valid a={3,4,{7,5}} print(a[2][0])

1.  Yes, 7 is printed

2.  Error, elements of a set can’t be printed

3.  Error, subsets aren’t allowed

4.  Yes, {7,5} is printed

4

Error, subsets aren’t allowed

Explanation :
No Explanation available for this question

# Which of these about a frozenset is not true

1.  Mutable data type

2.  Allows duplicate values

3.  Data type with unordered values

4.  Immutable data type

4

Mutable data type

Explanation :
No Explanation available for this question

# What is the syntax of the following Python code >>> a=frozenset(set([5,6,7])) >>> a

1.  {5,6,7}

2.  frozenset({5,6,7})

3.  Error, not possible to convert set into frozenset

4.  Syntax error

4

frozenset({5,6,7})

Explanation :
No Explanation available for this question

# Is the following Python code valid >>> a=frozenset([5,6,7]) >>> a >>> a.add(5)

1.  Yes, now a is {5,5,6,7}

2.  No, frozen set is immutable

3.  No, invalid syntax for add method

4.  Yes, now a is {5,6,7}

4