Unterricht Mittwoch

This commit is contained in:
Max
2026-07-22 12:04:02 +02:00
parent 33a5c4df89
commit 6a29bc0f51
13 changed files with 915 additions and 43 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*")