标签:数字 error erro print class turn type 字符 highlight
def is_number(s): try: float(s) return True except ValueError: pass try: import unicodedata unicodedata.numeric(s) return True except (TypeError, ValueError): pass return False str = ‘1109‘ if is_number(str): print(‘is number‘) else: print(‘is not number‘)
标签:数字 error erro print class turn type 字符 highlight
原文地址:https://www.cnblogs.com/xiaomaolove/p/9528736.html