Quiz Catalog

Catalog of quizzes

t = ([17, 9, 59], 12, 9, "rt9y", 11, 3 * 3, 0., 9 / 3 * 3, "3" * 3)

print(t.count(9))
3
  • tuple/operation/count

a = (1, 2, 3, 2, 1)
b = range(1, 6)

for x in b:
  if a.__contains__(x):
    a += (a.count(x),)

print(a)
(1, 2, 3, 2, 1, 2, 3, 2)
  • tuple/operation/contains
  • tuple/operation/count
  • build-in/range

value = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5)
x = value.count(5)

print(x)
2
  • tuple/operation/count