[Python] Can I write a class function in Codecombat?

When I write the following code, it doesn’t work. But it seems OK

class Test(object):
    a = 1
    def plus(self): 
        return self.a + 1

a = Test()
self.say(a.plus())

I don’t think you can write classes. The keyword self is already used for most of the methods.

We need to do some more work on our transpiler before we can support classes, but we will get them implemented eventually!

1 Like