-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bd9770
commit 6452084
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Getting started | ||
To start, install ufpy lib by command | ||
### Windows | ||
pip install ufpy | ||
### Linux | ||
|
||
|
||
## Examples | ||
To create stack, use UStack class. | ||
stack = UStack() | ||
To add an element to the stack, use UStack.append([<element1>, <elementN, ...]) | ||
stack.append(1, 2, 3, 4, 5) | ||
To get the top element, use UStack.top() | ||
print(stack.top()) | ||
# 5 | ||
To get and remove the top element of the stack, use UStack.pop() | ||
print(stack.pop()) | ||
# 5 | ||
print(stack.top()) | ||
# 4 | ||
## All methods | ||
| Name | Args | | ||
| ------- | ------- | | ||
| top | null | | ||
| append | **items | | ||
| pop | null | |