Tag: advanced topics
-
Python Questions and Answers – Sets – 4
Python Multiple Choice Questions & Answers (MCQs) focuses on “Sets – 4”. Q 1. What will be the output of the following Python code? s1={3, 4}s2={1, 2}s3=set()i=0j=0for i in s1:for j in s2:s3.add((i,j))i+=1j+=1print(s3)A. {(3, 4), (1, 2)}B. {(4, 2), (3, 1), (4, 1), (5, 2)}C. {(3, 1), (4, 2)}D. Error Show Answer Answer:-B. {(4, 2),…