How to understand python classes?
Question: Hello I'm learning python, it is also my first language. I'm trying to figure
out how classes work. I have this small code and I can't get it to work after
a week of searching. Thank you for helping me.

Also I'm trying to figure out what getattr and super do. I read on the
documentation but its not easy for me to understand. English is not my native
language and its a little difficult to understand sometimes.If you can explain
this two things or if you know any website that explains it in a simple way I
would really thank you for it.

here is the code:

    
    
    import sys
    
    
    class Map(object):
        dicti = {'stuff': stuff(),
                 'more_stuff': more_stuff()
        }
    
        class Stuff:
    
            def stuff(self):
                print "did it work?"
                next = raw_input("type next: ")
    
                if next == "next":
                    return 'more_stuff'
                else:
                    print "what? lets try again."
                    return 'stuff'      
    
        class MoreStuff:
    
            def more_stuff(self):
                print "ok"
    
                next = raw_input('type next: ')
    
                if next == "next":
                    return 'stuff'
    
                else:
                    print "bye."
                    sys.exit(0)
    
    
    class NewClass(Map):
    
        def __init__(self, themap):
    
            self.themap = themap
    
        def Continu(self):
    
            next = self.themap
    
            while True:
                print "----"
    
                room = next()
    
    
    
    
    a_test = NewClass('stuff')
    a_test.Continu()
    


Answer: You are passing the string `'stuff'` into `NewClass`, so that is becoming
`self.themap`

later you are assigning `next = self.themap`, so now `next` is also a
reference to the string `'stuff'`.

`room = next()` will fail because you can't call a string

