Question
SYNTAX ERROR with the following code: I bolded and underlined where It keeps saying my error is at...I tried to get in touch with the
SYNTAX ERROR with the following code: I bolded and underlined where It keeps saying my error is at...I tried to get in touch with the tutor that helped me with this but I could not find how to send a message to them :(
import re
def printWelcome():
print("Welcome to the Password checker program!")
print("This program checks if your string meets the following criteria:")
print("- Password length should be at least 10 characters")
print("- Password should have at least two capital letters")
print("- Password should have at least one lowercase letter")
print("- Password should have at least two special characters")
print("- Password should have at least one number")
def passwordChecker(password):
# Check password length
if len(password) < 10:
return False
# Check for at least two capital letters
if len(re.findall(r'[A-Z]', password)) < 2:
return False
# Check for at least one lowercase letter
if len(re.findall(r'[a-z]', password)) < 1:
return False
# Check for at least two special characters
if l..!@#$%^&*(),.?":{}|<>]', password)) < 2:
return False
# Check for at least one number
if len(re.findall(r'[0-9]', password)) < 1:
return False
return True
def main():
printWelcome()
while True:
password = input("Enter a string to continue, q to quit: ")
if password == "q":
break
elif passwordChecker(password):
print(password + " meets the criteria")
else:
print(password + " does not meet the criteria")
print("Thank you!")
if __name__ == '__main__':
main()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started