if word == "this" or "that":
...
Not an error, always runs. Very mysterious to a beginner. (Shared with C/C++) Another one: counter = "0"
for thing in things:
if matches(thing):
counter += 1
The error is in the init, by someone who is overzealous with their quoting, but the error is reported, as a runtime error, on the attempted increment, which throws a TypeError and helpfully tells them "must be str, not int", and of course I know exactly why it's reporting the problem there and why it's giving that error, but it's a bit confusing to the newbie programmer and it doesn't even turn up until they actually test their code effectively, which they are also still just learning how to do.No comments yet.