“Auto -python” Respostas de código

classes em python com auto -parâmetro

self represents the instance of the class. By using the “self” keyword we can access the attributes and methods of the class in python. It binds the attributes with the given arguments. 
Dull Dogfish

O que é eu em Python

self is used to refer to the specific object that is calling that function
Obedient Oystercatcher

Auto -python

class A(object):

    @staticmethod
    def stat_meth():
        print("Look no self was passed")
>>> a = A()
>>> a.stat_meth()
Look no self was passed
ap_Cooperative_dev

Respostas semelhantes a “Auto -python”

Perguntas semelhantes a “Auto -python”

Mais respostas relacionadas para “Auto -python” em Python

Procure respostas de código populares por idioma

Procurar outros idiomas de código