1、通过创建自定义函数is_number()方法来判断字符串是否为数字. 示例:. def is_number(s). try: float(s). return True. except ValueError:.
確定! 回上一頁