If the my_list variable is global, you can't do:
my_list = []
that just create a new reference in the local scope.
Also, I found disgusting using the global keyword, so how can I empty a list using its methods?
del a[:]
or
a[:] = []
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With