Which of the following functions cannot be used on heterogeneous sets

1.  pop

2.  remove

3.  update

4.  sum

4

sum

Explanation :
No Explanation available for this question

What will be the output of the following Python code s={4>3, 0, 3-3} all(s) any(s)

1.  TrueFalse

2.  FalseTrue

3.  True True

4.  FalseFalse

4

False
True

Explanation :
No Explanation available for this question

Which of the following functions will return the symmetric difference between two sets, x and y

1.  x | y

2.  x ^ y

3.  x & y

4.  x – y

4

x ^ y

Explanation :
No Explanation available for this question

What will be the output of the following Python code snippet z=set('abc\$de') 'a' in z

1.  True

2.  False

3.  No output

4.  Error

4

True

Explanation :
No Explanation available for this question

What will be the output of the following Python code snippet z=set('abc') z.add('san') z.update(set(['p', 'q'])) z

1.  {‘abc’, ‘p’, ‘q’, ‘san’}

2.  {‘a’, ‘b’, ‘c’, [‘p’, ‘q’], ‘san}

3.  {‘a’, ‘c’, ‘c’, ‘p’, ‘q’, ‘s’, ‘a’, ‘n’}

4.  {‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}

4

{‘a’, ‘b’, ‘c’, ‘p’, ‘q’, ‘san’}

Explanation :
No Explanation available for this question

What will be the output of the following Python code snippet s=set([1, 2, 3]) s.union([4, 5]) s|([4, 5])

1.  {1, 2, 3, 4, 5}{1, 2, 3, 4, 5}

2.  Error{1, 2, 3, 4, 5}

3.  {1, 2, 3, 4, 5}Error

4.  ErrorError

4

{1, 2, 3, 4, 5}
Error

Explanation :
No Explanation available for this question

What will be the output of the following Python code snippet for x in set('pqr'): print(x*2)

1.  ppqqrr

2.  pqrpqr

3.  ppqqrr

4.  pqrpqr

4

pp
qq
rr

Explanation :
No Explanation available for this question

What will be the output of the following Python code snippet {a**2 for a in range(4)}

1.  {1, 4, 9, 16}

2.  {0, 1, 4, 9, 16}

3.  Error

4.  {0, 1, 4, 9}

4

{0, 1, 4, 9}

Explanation :
No Explanation available for this question

What will be the output of the following Python function {x for x in 'abc'} {x*3 for x in 'abc'}

1.  {abc}aaabbbccc

2.  abcabc abc abc

3.  {‘a’, ‘b’, ‘c’}{‘aaa’, ‘bbb’, ‘ccc’}

4.  {‘a’, ‘b’, ‘c’}abcabcabc

4

{‘a’, ‘b’, ‘c’}
{‘aaa’, ‘bbb’, ‘ccc’}

Explanation :
No Explanation available for this question

1.  True

2.  False

2