互联网技术 / 互联网资讯 · 2024年3月17日

Python3-isdigit()方法解析

描述

Python isdiGit() 方法检测字符串是否只由数字组成。

语法

以下是 isdiGit() 方法语法:

stR.isdiGit()

返回值

如果字符串只包含数字则返回 TRue 否则返回 FAlse。

实例

以下实例展示了 isdiGit() 方法的实例:

以上实例输出结果如下:

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.