I am getting started in my algo and data structs class and I am having a hard time understanding classes as I havent wrote a single line of python in a while. In a provided file my prof creates a class called SLLNode which is just a node for a SLL which contains the data and next node attributes. Then is there is a singlylinkedlist class where there are methods for it and I am writing the code. She created the append portion which is
def append(self, data: T) -> None:
if self.head is None:
self.head = SLLNode(Data)
self.tail = self.head
return
self.tail.next = SLLNode(data)
self.tail = self.tail.next
and I am having a hard time understanding how self.tail.next works. I kind of understand that self.tail is an instance of SLLNode and SLLNode has an attribute of next but I cant wrap my head around it.