How is floor division not giving result according to the documented rule?

>>> print (12//0.2) 59.0 >>> print(floor(12/0.2)) 60 Why floor division is not working according to the rule in this case? p.s. Here Python is treating 0.2 as 0.20000000001 in the …

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

Is there a “not equal” operator in Python?

How would you say does not equal? Like if hi == hi: print “hi” elif hi (does not equal) bye: print “no hi” Is there something equivalent to == that means “not equal”?