I'm a beginner to Python and I was fooling around trying to code user input's password. However, I can't get it to loop again if it fails. Please help hahah
import re
p = input("Password: ")
x = True
while x:
if (len(p)<8 or len(p)>32):
break
elif not re.search("[a-z]",p):
break
elif not re.search("[0-9]",p):
break
elif not re.search("[A-Z]",p):
break
elif not re.search("[$#@]",p):
break
elif not re.search("\s",p):
break
else:
print("Valid Password")
x=False
break
if x:
print("Not a Valid Password. Please type again.")
p = input("Password: ")