Quiz Catalog

Catalog of quizzes

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 = 0.1 + 0.2

print(a == float(0.3))
False
  • expression/operation/equality