With Python 3.4 and in a function, this piece of code appears:
ch0 = \'dico[\\\'\'+ ans +\'\\\']\' # dico is a dictionary and ans is a key of this dictionary
pr
As documented in the exec documentation for Python 3:
Note: The default locals act as described for function locals() below: modifications to the default locals dictionary should not be attempted. Pass an explicit locals dictionary if you need to see effects of the code on locals after function exec() returns.
You can't create new local variables with exec
on Python 3. Local variable lookup completely ignores the attempt.