Skip to content

Conversation

@Bhakti23-CE
Copy link

###Summary:
This PR introduces a new Python program that implements a stack class with various operations, allowing user interaction.

###Features added:
Stack class with methods:

  • push: Pushes an item onto stack.
  • pop: Pop the top item of the stack and handle empty stack case.
  • peek: Returns the top element of stack without removing and checks if stack is empty.
  • is_empty: Checks if the stack is empty.
  • size: Returns the current size of the stack.
  • print_stack: Prints the elements present in stack.

Main Function:

  • Provides menu with options to perform stack operations.
  • Handles invalid inputs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant