Report Bug

Qus

What will be the output of the following Python code?

s={2, 5, 6, 6, 7}

s

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


A. {2, 5, 7}
B. {2, 5, 6, 7}
C. {2, 5, 6, 6, 7}
D. Error


Solution
B. {2, 5, 6, 7}



Explanation
Duplicate values are not allowed in sets. Hence, the output of the code shown above will be a set containing the duplicate value only once. Therefore the output is: {2, 5, 6, 7}
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