Unterricht Dienstag

This commit is contained in:
Max
2026-07-21 12:01:43 +02:00
parent 68ab58d4a5
commit fc527cf8f4
9 changed files with 1273 additions and 76 deletions
+20
View File
@@ -0,0 +1,20 @@
class Telefon:
def __init__(self, netz:str, *args):
self.__netz = netz
super().__init__(*args)
@property
def netz(self) -> str:
return self.__netz
@netz.setter
def netz(self, netz:str):
self.__netz = netz
# Python unterscheidet zwischen Klassenmethoden und statischen Methoden.
# Eine Klassenmethode kann auf Klassenattribute über cls zugreifen. Eine statische Methode kann das nicht.
@staticmethod
def klingeln(anzahl:int = 1):
print(anzahl * "*klingel*")