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

What is the correct fix?

total = 0
for row in rows:
    total += row
print("total: " + total)
  1. Convert it: "total: " + str(total)
  2. Convert it: "total: " + int(total)
  3. Change total = 0 to total = ""
  4. Use print("total: ", + total) here
A str and an int cannot be concatenated; convert the number with str().
Play Problem Solving ▸