MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / is_operand

Function is_operand

data_structures/stacks/prefix_evaluation.py:14–23  ·  view source on GitHub ↗

Return True if the given char c is an operand, e.g. it is a number >>> is_operand("1") True >>> is_operand("+") False

(c)

Source from the content-addressed store, hash-verified

12
13
14def is_operand(c):
15 """
16 Return True if the given char c is an operand, e.g. it is a number
17
18 >>> is_operand("1")
19 True
20 >>> is_operand("+")
21 False
22 """
23 return c.isdigit()
24
25
26def evaluate(expression):

Callers 2

evaluateFunction · 0.85
evaluate_recursiveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected