1What is the output of the following code?print([(i, j) for i in range(2) for j in range(2) if i != j])A[(1, 0), (0, 1)]B[(0, 1)]C[(0, 1), (1, 0)]D[(0, 0), (1, 1)]View AnswerDiscussWorkspaceReportSaveEasy
2What is the output of the following code?print({x % 3 for x in range(10)})A[0, 1, 2]B{1, 2, 3}C{0, 3, 6, 9}D{0, 1, 2}View AnswerDiscussWorkspaceReportSaveEasy
3What is the output of the following code?g = (x * 2 for x in range(3)) print(next(g), next(g))A0 2BErrorC0 1D2 4View AnswerDiscussWorkspaceReportSaveEasy
4What is the output of the following code?def gen(): yield 1 yield 2 print(list(gen()))A[1, 2]B2C[1]D<generator>View AnswerDiscussWorkspaceReportSaveEasy
5What is the output of the following code?print({c for c in 'hello'} == set('helo'))AErrorBTrueC4DFalseView AnswerDiscussWorkspaceReportSaveEasy