However, when I was running it, I discovered that although my end results were right (and that's all that mattered), the value of "ct" was never incremented. It was only being displayed as a reference, so I didn't really care. When I finally had the time to look at it more closely, I discovered that thanks to my wonderful typing skills, my code was actually written as "ct ++1" instead of "ct +=1". I never did get a syntax or other error, but a quick search didn't reveal anything about what I was doing with the "ct++1" statement. Can someone clarify what that syntax actually does, if anything?

I see that metulburr already posted the simple answer while I was composing my reply but I have reputation (especially at work) of complicated answers, so I'll still post my answer.

Numeric types support a __neg__ method that returns a number with sign changed. Numeric methods also support a __pos__ method which (usually) returns the number unchanged. When multiple + or - symbols are present between two objects, the first symbol becomes addition or subtraction. The remaining symbols are applied directly to the right hand object by calling __neg__ or __pos__ as appropriate.

The += operator calls the __iadd__ method. Glossing over a few details, your intended code would be equivalent to:

Can the + operator ever return a different number? Surprisingly, yes. For numeric types that have parameters that can be specified (say the precision of Decimal numbers), the + operator returns a number that is guaranteed to fit into the current precision. For example, if you have a value calculated to 50 digits of precision, and then you change the current precision to 40 digits, the + operator will return a number with 40 digits of precision.

So, in really simple terms, I was incrementing "ct" but not saving the result, so the value always changed from 0 to 1. And since I never saved it anywhere, when I printed it after the end of my loop, it showed 0, which is correct in terms of what I was asking for, but not what I was expecting.