Quiz Catalog

Catalog of quizzes

print(bool('False'), bool('True'))
True True
  • boolean/literal

a = 0
b = True
c = a + b

print(c is True)
False
  • boolean/literal
  • boolean/operation/add
  • expression/operation/is

a = "True"
b = True
c = 1

print(a == b)
print(b == c)
False True
  • boolean/literal
  • boolean/operation/compare

lst = [True, False]

print(lst[False])
print(lst[lst[False]])
True False
  • boolean/literal
  • list/literal

a = False

for x in range(1, 3):
  a = not a

print(a)
False
  • boolean/literal
  • boolean/operation/not
  • build-in/range

data = [([]), [()]]

for i in data:
  print(bool(i), end=' ')
False True
  • boolean/literal

assert "hello, world" is True
AssertionError
  • statement/assert
  • expression/operation/is
  • boolean/literal

value = True
assert value == True 
''
  • statement/assert
  • boolean/literal
  • boolean/operation/compare

lst = [1, 'non-empty string', True, '', False, 0, None]
st = set(lst)

print(len(st))
5
  • set/comprehension
  • boolean/literal

value = True
if value is not False:
  print("False")
else:
  print("True")
False
  • statement/not
  • statement/is
  • boolean/literal