Answer the question
In order to leave comments, you need to log in
How to end my python program?
I want to write a program that accepts a password, checks against two criteria 1- It must be longer than 8 characters, 2- it must not contain "123" and "password", if the criteria match, the program must ask for the password a second time, and check for do they differ
while True:
password1 = str(input("Введите пароль "))
len(password1)
if len(password1) < 8:
print("Короткий!")
elif "123" in password1 or "password" in password1:
print("Простой!")
password2 = str(input("Введите пароль еще раз "))
if password1 == password2:
print("OK")
break
else:
print("Различаются!")
Answer the question
In order to leave comments, you need to log in
black_list = ['password']
while True:
password1 = str(input("Введите пароль "))
if len(password1) < 8:
print("Короткий!")
continue
elif password1 in black_list:
print("Простой!")
continue
password2 = str(input("Введите пароль еще раз "))
if password1 == password2:
print("OK")
break
else:
print("Различаются!")
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question