Invalid syntax using += operator

I keep getting a syntax error when using += in python here is my code. I am also having troule with nonlocal. I am getting lots of errors including syntax errors and unbound local error Thanks in advance!!! update: more code added this is all the code It now says local variable ‘citizens’ referenced before assignment Answer Three things with this code: the rnum assignment will fail because you are not doing integer division You actually want global not non-local in this case. Though you should avoid using global variables like this. You can do the second line as part