class Node:
def __init__(self, value):
self.value = value
self.next = None
class LinkedList:
def __init__(self):
self.head = None
def append(self, value):
if self.head is None:
self.head = Node(value)
return
# Move to the tail (the last node)
node = self.head
while node.next:
node = node.next
node.next = Node(value)
return
I'm a little confused on how the while loops statement works in this context. While loops are suppose to work as long as the condition is true. I am not sure how the while loop condition would return true or false in this context can someone please explain. Thank you!