网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 时尚美容

python的字符串内建函数5

时间:2024-10-15 11:19:18

python中string模块有很多字符串的方法,下面简单列几个方法。

python的字符串内建函数5

工具/原料

电脑

python

字符串内建函数:

1、string.isdecimal():如果string只包含十进制数字,则返回True,否则返回False。

python的字符串内建函数5python的字符串内建函数5

2、string.isdigit():如果string中只包含数字,则返回True,否则返回False。

python的字符串内建函数5python的字符串内建函数5

3、string.islower():如果string中区分大小写的字符都是小写,则返回True,否则返回False。

python的字符串内建函数5python的字符串内建函数5

4、string.isnumeric():如果string中只包含数字,则返回True,否则返回False。

python的字符串内建函数5python的字符串内建函数5
© 2025 小知经验
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com