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

Which fix removes the bug?

age = input('Age: ')
print(age + 1)
  1. Convert with int() first
  2. Use print(age, 1) instead
  3. Declare age as global
  4. Call str() on the 1
input() always returns a string, and adding an int to a str raises TypeError.
Play Problem Solving ▸