Return True if the given char c is an operand, e.g. it is a number >>> is_operand("1") True >>> is_operand("+") False
(c)
| 12 | |
| 13 | |
| 14 | def 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 | |
| 26 | def evaluate(expression): |
no outgoing calls
no test coverage detected