def is_num(text): for char in text: if not isdigit(char): return False return True