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

What is the correct fix?

nums = [10, 20, 30]
print(nums[3])
  1. Change nums[3] to nums(3)
  2. Use nums.get(3)
  3. Add a fourth element silently
  4. Change nums[3] to nums[2]
Valid indices are 0..2; index 3 is out of range.
Play Problem Solving ▸