¡GoConqr estrena diseño! Cuéntanos qué te parece.

Apuntes

Python - Classes

muki vs Programming Python Inglés 1 página

Contenido del apunte (1)

Página 1

#

# Example file for working with classes

# (For Python 3.x, be sure to use the ExampleSnippets3.txt file)

class myClass():

def method1(self):

print "myClass method1"

def method2(self, someString):

print "myClass method2: " + someString

class anotherClass(myClass):

def method2(self):

print "anotherClass method2"

def method1(self):

myClass.method1(self);

print "anotherClass method1"

def main():

c = myClass()

c.method1()

c.method2("This is a string")

c2 = anotherClass()

c2.method1()

if __name__ == "__main__":

main()

Información

Descripción
Reference code to classes
Creado por
muki vs
Visitas
23
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?