s.isalnum() 所有字符都是数字或者字母,为真返回 Ture,否则返回 False。
s.isalpha() 所有字符都是字母,为真返回 Ture,否则返回 False。
s.isdigit() 所有字符都是数字,为真返回 Ture,否则返回 False。
import re
n = int(input())
for i in range(n):
ipt = input()
if len(ipt)<6:
print("Your password is tai duan le.")
else:
a = re.findall(r'[^A-Za-z0-9.]',ipt)
if a!= []:
print("Your password is tai luan le.")
else:
if ipt.replace(".","").isdigit():
print("Your password needs zi mu.")
elif ipt.replace(".","").isalpha():
print("Your password needs shu zi.")
else:
print("Your password is wan mei.")