Function to insert a node at the beginning
def insert ( ref_head , item ) : NEW_LINE INDENT global head NEW_LINE temp = Node ( ) NEW_LINE temp . data = item NEW_LINE temp . next = ref_head NEW_LINE head = temp NEW_LINE DEDENT