• Globals not properly handled in python interpreter

 

I would like to give some feedback about ...

From: https://py.checkio.org/mission/restricted-sum/solve/

HTTP_USER_AGENT:

Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

This solution erroneously fails. It appears that globals are not properly supported by your python interpreter.

def checkio(data):
    global s
    s = 0
    map(doit, data)
    return s

def doit(n):
  global s
  s+=n

On my machine (Python 3.5.2), checkio([1,2,3,4]) == 10. In your interpreter, I get 0. It would appear that the global variable "s" is not getting updated.

5