Compilador de Python Online (Editor / Interpretador)
Escreva, execute e compartilhe o seu código Python instantaneamente com o Compilador de Python Online da Asimov Academy.
import re
def e_numero_regex(s):
""" Retorna True se a string for um número. """
if re.match("^\d+?\.\d+?$", s) is None:
return s.isdigit()
return True
print(e_numero_regex('o')) #saída False