$ ./guess_the_languageProblem Solving — fix the bug
Problem Solving — fix the bug · medium · #233

Which fix removes the bug?

colors = ('red')
for c in colors:
    print(c)  # expected: red
  1. Add a comma: ('red',)
  2. Use list('red') there
  3. Write tuple('red')
  4. Use str('red') here
Parentheses alone do not make a tuple, so colors is a string and the loop walks its letters.
Play Problem Solving ▸