Hi there,
I’m confused about this part:
def insert_after_node(self, prev_node, data):
** if not prev_node:**
** print(“Previous node does not exist.”)**
** return**
We haven’t defined prev_node before, it’s just an input. Why we can directly write “if not prev_node” here? And I’m not sure if I understand it in a right way. Whether the code here is for checking our input prev_node is in the linked list or the linked list is empty or not.
Thank you very much!