Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
if_else version solution in Creative category for Acceptable Password I by Sofiane-Bekkari
def is_acceptable_password(password: str) -> bool:
# your code here
# use if statement to check it
if len(password) <= 6:
# print this message if it great or equal 6
print('Password is weak!')
return False
else:
# otherwise print this
print('Password is strong!')
return True
if __name__ == '__main__':
print("Example:")
print(is_acceptable_password('short'))
# These "asserts" are used for self-checking and not for an auto-testing
assert is_acceptable_password('short') == False
assert is_acceptable_password('muchlonger') == True
assert is_acceptable_password('ashort') == False
print("Coding complete? Click 'Check' to earn cool rewards!")
Aug. 23, 2020
Comments: