python代码,样例通过但是红了,求指导
查看原帖
python代码,样例通过但是红了,求指导
1467792
PPAP91楼主2024/11/28 17:29

a=str(input()) a= a.split(",", -1)#分段 for i in a: b=0 e = n = t = a =0 if len(i)>12 or len(i)<6:#判断长度 continue else: for j in i: #截取字符串判断是否合法 if 97<=ord(j)<=122 or 65<=ord(j)<=90 or ord(j)==33 or ord(j)==64 or ord(j)==35 or ord(j)==36 or 48<=ord(j)<=57: if 97<=ord(j)<=122 :#统计整数大小写字母和特殊字符个数 e += 1 elif 65<=ord(j)<=90: a += 1 elif 48<=ord(j)<=57: n += 1 elif ord(j)==33 or ord(j)==64 or ord(j)==35 or ord(j)==36: t += 1 else: b=b+1 break if b==1 or t==0 :#字符不合法以及特殊字符小于一个,跳过 continue elif ea==0 or en==0 or a*n==0:#大小写字母和数字种类小于两个,跳过 continue print(i)

2024/11/28 17:29
加载中...