What Will Be The Output Of The Following Python Codep Pre #513
What will be the output of the following Python code?</p> <pre><code class="language-python"> >>> a={1,2,3} >>> {x*2 for x in a|{4,5}} </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.3.
What will be the output of the following Python code?
>>> a={1,2,3} >>> {x*2 for x in a|{4,5}}
{2,4,6}
Error, set comprehensions aren’t allowed
{8, 2, 10, 4, 6}
{8,10}