Is The Following Python Code Validp Pre Langpython #501
Is the following Python code valid?</p> <pre><code class="language-python"> a={3,4,{7,5}} print(a[2][0]) </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs109 Python. It can also be found in gs gs109 Python Sets - Python Sets - Quiz No.2.
Is the following Python code valid?
a={3,4,{7,5}} print(a[2][0])
Yes, 7 is printed
Error, elements of a set can’t be printed
Error, subsets aren’t allowed
Yes, {7,5} is printed