Function to insert a node at the beginning of a linked list
def insertAtTheBegin ( start_ref , data ) : NEW_LINE INDENT ptr1 = Node ( data ) NEW_LINE ptr1 . data = data ; NEW_LINE ptr1 . next = start_ref ; NEW_LINE if ( start_ref != None ) : NEW_LINE ( start_ref ) . prev = ptr1 ; NEW_LINE start_ref = ptr1 ; NEW_LINE return start_ref NEW_LINE DEDENT