def is_password_good(password):
total = 0
if len(password) > 7:
total += 1
if password.isalnum():
total += 1
for i in password:
if i.islower():
total += 1
break
for i in password:
if i.isupper():
total += 1
break
if total >= 4:
return True
elif total < 4:
return False
txt = input()
print(is_password_good(txt))
Задания снизу на скриншоте и там же код:
total = 0
if len(password) > 7:
total += 1
if password.isalnum():
total += 1
for i in password:
if i.islower():
total += 1
break
for i in password:
if i.isupper():
total += 1
break
if total >= 4:
return True
elif total < 4:
return False
txt = input()
print(is_password_good(txt))
Задания снизу на скриншоте и там же код: