Skip to content

Issue in Peek method inside stack.py #1

@anantkaushik

Description

@anantkaushik

If the stack is empty and we call peek method then it will throw "IndexError: list index out of range" error.
You should check for the size of the stack inside peek method before returning the value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions