Report Bug

QusIf a={5,6,7}, what happens when a.add(5) is executed? Qusयदि a = {5,6,7}, तो क्या होता है जब a.add (5) निष्पादित होता है?


A. a={5,5,6,7}
B. a={5,6,7}
C. Error as there is no add function for set data type
D. Error as 5 already exists in the set


Solution
B. a={5,6,7}



Explanation
There exists add method for set data type. However 5 isn’t added again as set consists of only non-duplicate elements and 5 already exists in the set. Execute in python shell to verify.
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