3个回答
2022-05-07 · 学动漫、设计、电竞、电商、短视频、软件等
关注
展开全部
#!/usr/bin/ python
#-*- coding: utf-8 -*-#author : zhoulong_GISER
# blog:https: //blog.csdn.net/qq_33356563
#判断字符串是否是数字(数字、小数、负数、负小数、0)#字符串
str_numbers = ["-0.3", "e","2","e.002","-5","china","中国","-like" ,"-中国"]for str_number in str_numbers:
if (str_number.split(".")[0]).isdigit() or str_number . isdigit() or (str_number.split('-')[-1]).split(".")[-1].ist
print(str_number+"是数字")
else:
print(str_number+”不是数字")
#-*- coding: utf-8 -*-#author : zhoulong_GISER
# blog:https: //blog.csdn.net/qq_33356563
#判断字符串是否是数字(数字、小数、负数、负小数、0)#字符串
str_numbers = ["-0.3", "e","2","e.002","-5","china","中国","-like" ,"-中国"]for str_number in str_numbers:
if (str_number.split(".")[0]).isdigit() or str_number . isdigit() or (str_number.split('-')[-1]).split(".")[-1].ist
print(str_number+"是数字")
else:
print(str_number+”不是数字")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
一般般吧,不算好也不算差,可以给70分左右。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询