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

What is printed?

a = [1, 2]
b = a
b.append(3)
print(len(a))
  1. 3
  2. 2
  3. 4
  4. 1
b is another name for the same list, so appending is visible through a.
Play Problem Solving ▸