Quiz Catalog

Catalog of quizzes

a = 0
b = True
c = a + b

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

lst1 = [2, 5, 8, 0, 4, 1]
lst2 = lst1

print(lst1 is lst2, lst1 == lst2)
True True
  • list
  • expression/operation/is
  • expression/operation/equality

lst1 = [2, 5, 8, 0, 4, 1]
lst2 = lst1[:]

print(lst1 is lst2, lst1 == lst2)
False True
  • list/operation/slice
  • expression/operation/is
  • expression/operation/equality

lst1 = [2, 5, 8, 0, 4, 1]
lst2 = lst1.copy()

print(lst1 is lst2, lst1 == lst2)
False True
  • list/operation/copy
  • expression/operation/is
  • expression/operation/equality

a = "2"
b = 2
c = type(b)

if c(a) is b:
  print("True")
else:
  print("False")
True
  • expression/operation/is
  • type

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