mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-26 02:48:40 +00:00
Fixed return type hinting required by pre commit for evaluate function
Signed-off-by: Arijit De <arijitde2050@gmail.com>
This commit is contained in:
parent
800b07a34c
commit
70fd7fd5fe
@ -74,7 +74,7 @@ def is_operator(data: str) -> bool:
|
|||||||
return data in ["-", "+", "*", "^", "/"]
|
return data in ["-", "+", "*", "^", "/"]
|
||||||
|
|
||||||
|
|
||||||
def evaluate(post_fix: list, verbose: bool = False) -> int:
|
def evaluate(post_fix: list, verbose: bool = False) -> int | float | str | None:
|
||||||
"""
|
"""
|
||||||
Function that evaluates postfix expression using a stack.
|
Function that evaluates postfix expression using a stack.
|
||||||
>>> evaluate(["2", "1", "+", "3", "*"])
|
>>> evaluate(["2", "1", "+", "3", "*"])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user