Quiz Catalog

Catalog of quizzes

a = True

a -= True
print(a)
0
  • boolean

if True:
  print(1)
else:
  print(0)
1
  • boolean

x = None
print(bool(x))
False
  • build-in/bool
  • build-in/print
  • boolean

elements = ((), [], {}, 0, 0., "", False)
print(any(elements))
False
  • boolean

tpl = (4, 1, 0, 'a')

a = any(tpl)

print(a)
True
  • build-in/any
  • tuple/literal
  • boolean

if all([2, 0, 4]):
  print("Yes")
else:
  print("No")
No
  • build-in/all
  • list/literal
  • boolean

data = [2, 4, 5, 6, {}]

a = isinstance(data[4], dict)

print(a)
True
  • build-in/isinstance
  • list/literal
  • dict
  • boolean

class A:
  pass

class B(A):
  pass


print(issubclass(A, B))
False
  • build-in/issubclass
  • class/inheritance
  • boolean