def isdigit(st):
for ch in st:
if ch not in '0123456789':
return 'input the content is string'
return 'Iput the content is number'
if __name__ == '__main__':
st = input('Please input centent:')
result = isdigit(st)
print(result)
判断一个字符串是否数字或者字符
最新推荐文章于 2024-05-20 20:26:39 发布