这整个函数怎么循环调用呀
def check_number_exist(password_str):
for c in password_str:
if c.isnumeric():
return True
return False
def check_alpha_exist(password_str):
for c in password_str:
if c.isalpha():
return True
return False
def check_space_exist(password_str):
for c in password_str:
if c.isspace():
return False
return True
def main():
password = input('请输入密码')
strength_level = 0
if len(password) >= 8:
strength_level += 1
else:
print('密码长度要求至少8位数!')
if check_number_exist(password):
strength_level += 1
else:
print('密码要求包含数字!')
if check_alpha_exist(password):
strength_level += 1
else:
print('密码要求包含字母!')
if check_space_exist(password):
strength_level += 1
else:
print('密码不要求包含空格!')
if strength_level == 4:
print('恭喜!密码强度合格!')
else:
print('密码强度不合格!')
if name == 'main':
main()