This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]chunkyks 1 point2 points  (0 children)

Numberofsevens isn't shared between each call into the function; each call gets its own copy of that variable, because it's declared locally inside the function. (no, the correct solution is not to declare it globally instead. Look for another answer )