$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · easy · #205

Which fix removes the bug?

nums = [1, 2, 3]
nums.add(4)
  1. Use nums.push(4)
  2. Use nums.append(4)
  3. Use nums += 4 here
  4. Use nums.insert(4)
Lists have no add method (that is for sets); append adds to the end.
Play Problem Solving ▸