Dies ist eine alte Version des Dokuments!
class test:
def say_something():
print("Hello")
a=test()
a.say_something()
class static_test:
my_string = "Peter"
@staticmethod
def ausgabe():
print("Ausgabe")
def caller(self):
self.ausgabe()
static_test.ausgabe()
a = static_test()
a.ausgabe()
class static_test:
my_string = "Peter"
@classmethod
def ausgabe(cls):
print("Ausgabe", cls.my_string)
def caller(self):
self.ausgabe()
static_test.ausgabe()
a = static_test()
a.ausgabe()