I started learning Python only last week,I am trying to write a password set-up and validation program for practice. The below is the code
set_password = input('set-up your password: ')
set_password_length = len(set_password)
if set_password_length >= 8:
elif set_password_length < 20:
re_confirm_password = input('reenter your password: ')
else:
print('password cannot be longer than 20 characters')
**break**
else:
print('password should be minimum 8 characters long')
**break**
if set_password == re_confirm_password:
print('you have successfully set your password')
login_password = set_password
else:
print('please enter the same password')
number_of_attempt = 1
while number_of_attempt <= 3:
number_of_attempt = number_of_attempt + 1
enter_password = input('Enter your password: ')
if enter_password == login_password:
print('login successful')
break
else:
print('you exceeded the limit,your account is locked')
but python is complaining about the break statements .Can anybody help to understand the mistake and guide me.
Thank you.