0
点赞
收藏
分享

微信扫一扫

Python 提取字符串中数字

def getnum(str):
    n=len(str)
    s=""
    for i in range(n):
        ss=str[i]
        if ss.isdigit():
            s=s+ss
    return s

 

举报

相关推荐

0 条评论