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

What is the correct fix?

age = "20"
next_year = age + 1
  1. Change + 1 to + "1"
  2. Use age++
  3. Wrap age with int(age)
  4. Remove the quotes around 20 only
A string cannot be added to an int; convert with int().
Play Problem Solving ▸