Quiz Catalog

Catalog of quizzes

numbers = [100, 200, 300]
iterator = iter(numbers)

print(len(iterator))
TypeError: object of type 'list_iterator' has no len()
  • iterator
  • build-in/len

a = f"{2e-3 + 0.001 - 1}"

print(len(a))
6
  • float
  • build-in/len

expression = (letter for letter in 'abc')
len(expression)
TypeError: object of type 'generator' has no len()
  • generator
  • build-in/len

s = "python"

print(len(s * 2 + ''))
12
  • string/operation/multiple
  • build-in/len

dct = {1: 2, 2: 3, 3: 4, 4: [2, 5, 6]}

b = len(dct)

print(b)
4
  • build-in/len
  • dict/literal