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

What is the correct fix?

names = ['ana', 'bob']
for i in range(1, len(names)):
    print(names[i])
  1. Start at zero: range(0, len(names))
  2. Start at zero: range(0, len(names) - 1)
  3. Change names[i] to names[i - 1]
  4. Iterate with for i in names instead
Indexes start at 0, so starting at 1 silently skips the first name.
Play Problem Solving ▸