Inside a function body, count is assigned without any global or nonlocal declaration. How does Python normally classify count in that function?
Explanation
Assignment makes count a local name for that function unless a relevant declaration changes the scope rule. Python does not decide between local and global dynamically according to which branch happens to execute.