$ ./guess_the_languageProblem Solving — predict the output
Problem Solving — predict the output · hard · #119

What is printed?

a = 256
b = int('256')
c = 1000
d = int('1000')
print(a is b, c is d)
  1. True False
  2. True True
  3. False False
  4. False True
CPython caches small integers up to 256, so 256 is reused while 1000 is a fresh object.
Play Problem Solving ▸