Report Bug

Qus

What will be the output of the following Python code snippet?

  z=set('abc$de')  'a' in z
Qusनिम्नलिखित Python कोड स्निपेट का आउटपुट क्या होगा?


A. True
B. False
C. No output
D. Error


Solution
A. True



Explanation
The code shown above is used to check whether a particular item is a part of a given set or not. Since ‘a’ is a part of the set z, the output is true. Note that this code would result in an error in the absence of the quotes.
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