Skip to content

Commit

Permalink
Fixed example (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAihopGG committed Jun 4, 2024
1 parent 6452084 commit e91aafa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/ustack_in_using.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,25 @@ pip install ufpy

## Examples
To create stack, use UStack class.
```python
stack = UStack()
```
To add an element to the stack, use UStack.append([<element1>, <elementN, ...])
```python
stack.append(1, 2, 3, 4, 5)
```
To get the top element, use UStack.top()
```python
print(stack.top())
# 5
```
To get and remove the top element of the stack, use UStack.pop()
```python
print(stack.pop())
# 5
print(stack.top())
# 4
```
## All methods
| Name | Args |
| ------- | ------- |
Expand Down

0 comments on commit e91aafa

Please sign in to comment.