Change the class attribute value outside the class

前端 未结 0 422
再見小時候
再見小時候 2020-12-14 03:19

I have a library like this:

class Robot:
    __counter = 0

    @classmethod
    def get_c(cls):
        result = cls.__counter + 1
        return result


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题