What Will Be The Output Of The Following Python Codep Pre #537
What will be the output of the following Python code?</p> <pre><code class="language-python">s1={3, 4} s2={1, 2} s3=set() i=0 j=0 for i in s1: for j in s2: s3.add((i,j)) i+=1 j+=1 print(s3)</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.6.
What will be the output of the following Python code?
s1={3, 4} s2={1, 2} s3=set() i=0 j=0 for i in s1: for j in s2: s3.add((i,j)) i+=1 j+=1 print(s3)
{(3, 4), (1, 2)}
Error
{(4, 2), (3, 1), (4, 1), (5, 2)}
{(3, 1), (4, 2)}