Quiz Catalog

Catalog of quizzes

lst1 = [x for x in range(6)]
lst2 = [y for y in range(9)]
a = lst1 + lst2

print(*a)
0 1 2 3 4 5 6 7 8
  • set
  • list/comprehension
  • build-in/set

x1 = [i for i in range(10) if i % 2 and i % 3]
x2 = x1
x2.append(e for e in range(8) if e not in x1)

print(x1)
[1, 5, 7, <generator object <genexpr> at 0x7f18ad923f40>]
  • list/comprehension
  • build-in/append
  • build-in/range
  • generator