If the my_dict variable is global, you can't do:
my_dict = {}
that just create a new reference in the local scope.
Also, I found disgusting using the global keyword, so how can I empty a dict using its methods?
If the my_dict variable is global, you can't do:
my_dict = {}
that just create a new reference in the local scope.
Also, I found disgusting using the global keyword, so how can I empty a dict using its methods?
Use the clear() method?
Documentation - (docs.python.org)