2nd Commit

This commit is contained in:
alstergym
2026-09-18 08:23:51 +02:00
parent b2537f607d
commit 5f376cc2cb
13 changed files with 122 additions and 35 deletions
+36
View File
@@ -0,0 +1,36 @@
class Schlange(object):
def __init__(self):
self.liste = []
self.anzahl = 0
def istLeer(self):
if self.anzahl == 0:
return True
else:
return False
def mitLetztem(self, element):
self.liste = self.liste + [element]
self.anzahl = self.anzahl + 1
def ohneErstes(self):
if not self.istLeer():
self.liste = self.liste[1:]
self.anzahl = self.anzahl - 1
def erstes(self):
if self.istLeer():
return None
else:
return self.liste[0]
def anzahlElemente(self):
return self.anzahl
def getSchlange(self):
return self.liste
def setSchlange(self, liste):
self.liste = liste
self.anzahl = len(self.liste)