OOP python program
Question: 
    from collections import Counter
    
    class Runlength:
        def __init__(self):
            self.str = 0 
    
        def returner(self,str):
            self.str = str 
            self.__str = ','.join(str(n) for n in self.__str)
            self.__str = self.__str[::-1]
            self.__str = self.__str.replace(',', '')
            return self.__str
        def final(self,num):
            self.num = num 
            k = []
            c = Counter(self.num).most_common()
            for x in c:
            k += x     
            return k
    math = Runlength() 
    
    def Main():
    a = "aabbcc"
    b = math.returner(a)
    c = math.final(b)
    print(c)
    Main()
    

The program takes a word as input and gives the occurrence of each repeating
character and outputs that number along with a single character of the
repeating sequence.

I cant figure it out, why this doesn't work. I get this error:

    
    
    NameError: global name 'returner' is not defined
    


Answer: The problem is that in `Main()` you are not accessing the global (outside the
scope of the `Main()` method) `math` variable. Instead try initializing your
`math` inside the `Main()` function

This lets the method know that it should use the global `math` variable
instead of trying to look for a non-existent local one.

