Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def get_passwd_from_user():
- from_user = input('input your password:\n>>')
- return from_user
- def is_mixed(passwd):
- numeric = False
- alpha = False
- special_char = False
- for char in passwd:
- if char.isalpha():
- alpha = True
- elif char.isnumeric():
- numeric = True
- else:
- special_char = True
- return (numeric and alpha) and special_char
- def main():
- while True:
- passwd_from_user = get_passwd_from_user()
- if len(passwd_from_user) < 8:
- print('8자 이상이어야 합니다.')
- elif not is_mixed(passwd_from_user):
- print('숫자 문자 특수문자가 1자 이상 포함되어야 합니다.')
- else:
- print('정상적인 패스워드 입니다.')
- break
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement