Python如何使用int()判断字符是否是数字?#Python2022-04-15 21:32分类:Python 0 条评论 请先 登录 后评论 默认排序 时间排序 1 个回答|254 次阅读 2022-04-15 21:32 Coco老师 - 官方公众号:青少儿编程学习网 擅长:编程教育 • 网站:https://kidscodes.cn/string = 'asdr1234' for i in string: try: int(i) print(i + '是数字字符') except Exception as e: print(i + '不是数字字符')结果是:a不是数字字符s不是数字字符d不是数字字符r不是数字字符1是数字字符2是数字字符3是数字字符4是数字字符 请先 登录 后评论