Quiz Catalog

Catalog of quizzes

from typing import Set

a: Set[int] = {1, 4, 5}

print(isinstance(a, Set[int]))
TypeError: Subscripted generics cannot be used with class and instance checks
  • type/annotation
  • built-in/isinstance

a: float = 1
b: float = 2

print((a + b).bit_length())
2
  • type/annotation
  • int/operation/bit_length

a: type = type(type)
b = type(int)
print(a is b)
True
  • type/annotation
  • build-in/type