Calculadora: criando a grid de botões
This commit is contained in:
11
aula202-calculadora/utils.py
Normal file
11
aula202-calculadora/utils.py
Normal file
@@ -0,0 +1,11 @@
|
||||
import re
|
||||
|
||||
NUM_OR_DOT_REGEX = re.compile(r'^[0-9.]$')
|
||||
|
||||
|
||||
def isNumOrDot(string: str):
|
||||
return bool(NUM_OR_DOT_REGEX.search(string))
|
||||
|
||||
|
||||
def isEmpty(string: str):
|
||||
return len(string) == 0
|
||||
Reference in New Issue
Block a user