C02_list/main.py

32 lines
591 B
Python
Raw Normal View History

2024-10-23 22:54:58 +02:00
from list import Liste
2024-10-20 18:27:58 +02:00
liste = Liste()
liste.insert(1)
2024-10-23 22:54:58 +02:00
liste.insert(2)
liste.insert(4)
liste.insert(3)
2024-10-20 18:27:58 +02:00
print("Inhalt der Liste:")
liste.show_list()
print("Länge der Liste:", liste.length())
print("Suche nach Wert 2:", liste.search(2).data if liste.search(2) else "Nicht gefunden")
2024-10-23 22:54:58 +02:00
print("---")
2024-11-03 17:49:02 +01:00
#liste.remove(1)
#liste.show_list()
2024-10-23 22:54:58 +02:00
2024-11-03 17:49:02 +01:00
#liste.insert_before(1, 2)
#print("Inhalt der Liste nach Einfügen von 1.5 vor 2:")
#liste.show_list()
2024-10-23 22:54:58 +02:00
#
# print("---")
# liste.remove_last()
# liste.remove_last()
2024-11-03 17:49:02 +01:00
# liste.show_list()
#liste.insert_sorted(5)
#liste.show_list()
print(liste.search_max())