isdigit、isnumeric、isdecimal

字符串的isdigit方法用于判断字符串是否只包含数字,即0-9的字符 print('1233'.isdigit()) # True print('12.33'.isdigit()) # False 字符串的isnumeric方法可用于判断字符串是否是数字,数字包括Unicode数字,byte数字(
posted @ 2023-05-26 11:46  sangern  阅读(27)  评论(0编辑  收藏  举报