Report Bug

Qus

What will be the output of the following Python code?

>>> a={1,2,3}

>>> {x*2 for x in a|{4,5}}

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


A. {2,4,6}
B. Error, set comprehensions aren’t allowed
C. {8, 2, 10, 4, 6}
D. {8,10}


Solution
C. {8, 2, 10, 4, 6}



Explanation
Set comprehensions are allowed.
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