#use a regular expression.
import re #import regular expression.
Password =input('Enter password:') #Request user input.
Secret_phrase=r'Ada Lovelace'#define the regular expression.
if re.match(Password,Secret_phrase):#use the re.match function to test if the user input matches the regular expression.
print('Correct!')
else:
print('Not Correct')
Comments
Leave a comment