Guided Project 1, removing non-English apps that have more than 3 characters outside the ASCII range

Why does the solution suggest initialising a variable with a value of 0 instead of using an empty list?

For the project we were working through an empty list could have worked, but it might have been overkill for what we were trying to accomplish.

With a List or Dictionary you would have been able to see the frequency of specific characters, or the specific characters that occurred, but in the case above they only wanted to know how many non-ASCII characters existed in the string without knowing specifically what they were. So they instantiated a variable with a 0 so that it could be used as a numeric counter.

1 Like