Report Bug

Qus

What will be the output of the following Python code?

>>> a={5,6,7,8}

>>> b={7,8,9,10} 

>>> len(a+b)

Qusनिम्नलिखित Python कोड का आउटपुट क्या होगा?


A. 8
B. Error, unsupported operand ‘+’ for sets
C. 6
D. Nothing is displayed


Solution
B. Error, unsupported operand ‘+’ for sets



Explanation
Duplicate elements in a+b is eliminated and the length of a+b is computed.
CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online Exam Quiz O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Best Website and Software Company in Allahabad Website development Company in Allahabad