I have this training exercise where I need to find the problems in this program. I can't find them and python tutor does not allow me to see the object created. It just says incomplete object. The program should create a kind of queue for strings. What is wrong with the code?
class A():
"""Eine Art Warteschlange für Strings"""
def __init__(self, wait = [], now = ""):
self.wait = wait
self.now = now
def new_string(self, x):
"""Fügt einen String zur Warteschlange hinzu"""
self.wait.append(str(x))
def next_string(self):
"""Holt den nächsten String aus der Warteschlange, speichert ihn als aktuellen String"""
self.now = self.wait[0]
self.wait.pop(0)
def top(self):
"""Gibt den aktuellen String zurück"""
return self.now
def __str__(self):
return self.top