Quiz Catalog

Catalog of quizzes

a = {el for el in "bacb-bd77-1abd-ac8b" if not el.isdigit()}

print(a)
{'-', 'b', 'c', 'd', 'a'}
  • set/comprehension

ids = {1, 2, 3, 4, 3}

print(ids[2])
TypeError: 'set' object is not subscriptable
  • set/comprehension

lst = [1, 'non-empty string', True, '', False, 0, None]
st = set(lst)

print(len(st))
5
  • set/comprehension
  • boolean/literal