Skip to content

Why are we not getting an error if the item "figs" isn't even in the list? #67

Open

Activity

ROMEEZHOU

ROMEEZHOU commented on Mar 3, 2023

@ROMEEZHOU

Because in the function remove_by_value(self,data), the function would return if data is found and deleted, or it would return when the while loop ends, i.e., we have reached the end of the linked-list without finding the desired data. So if "figs" isn't in the list, this function would return after it goes over the whole list. There would not be any error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ROMEEZHOU@whyevenquestion1t

        Issue actions

          Why are we not getting an error if the item "figs" isn't even in the list? · Issue #67 · codebasics/data-structures-algorithms-python