Quiz Catalog

Catalog of quizzes

a = {5, 4, 3, 2, 1}
b = {1, 2, 3, 6}
c = {7, 4, 2, 1}
c = c.union(a & b)

print(c)
{1, 2, 3, 4, 7}
  • set/operation/union
  • set/operation/definition

a = {3, 2, 1}
b = {1, 2, 3}

print(a.union(b).index(3))
AttributeError: 'set' object has no attribute 'index'
  • set/operation/union