I've been asked to create a program that identifies if a password is valid or not. The one part I am struggling with is identifying whether there are two of the same character adjacent to each other. Help would be appreciated and here is the program so far:
import repswrd = input("Enter Desired Password:")if len(pswrd) < 6:print("Password must have more than 6 characters.")
if len(pswrd) > 15:print("Password must have no more than 15 characters.")
if re.search("[$#@]",pswrd):print("Password must have no special characters.")
if not re.search("[0-9]",pswrd):print("Password must contain a number.")
if not re.search("[a-z]",pswrd):print("Password must contain a lower case letter.")
if not re.search("[A-Z]",pswrd):print("Password must contain an upper case letter.")