Question: I have a Python 3.x question from an intro to Python course and could use some help with this problem, please. Your security manager has

I have a Python 3.x question from an intro to Python course and could use some help with this problem, please.

Your security manager has just come up with a new rule to keep your passwords more secure: no letter may be followed by the same letter, and no digit may be followed by the same digit. So hello12, or secret99 are not legal passwords. On the other hand, 12345, or 12##pwd are alllowed (so you are allowed to double other symbols than letters and digits). You are responsible for implementing a function check_pwd(p) which takes p, a string containing the password, and returns True if and only if p satisfies the new anti-doubling rule (check_pwd need not check any other restrictions, like minimum length, etc.).

Here is a screenshot of the prompt as well as how it should look when run:

I have a Python 3.x question from an intro to Python course

Any help would be very much appreciated and with explanations of what's happening! Thank you!

3. (Password, 1Opt) Your security manager has just come up with a new rule to keep your passwords more secure: no letter may be followed by the same letter, and no digit may be followed by the same digit. So | hello12, or secret99 are not legal passwords. On the other hand, 12345, or 12##pwd are alllowed (so you are allowed to double other symbols than letters and digits). You are responsible for implementing a function check_pwd(p) which takes p, a string containing the password, and returns True if and only if p satisfies the | new anti-doubling rule (check_pwd need not check any other restrictions, like minimum length, etc.). Le Python 343 Shell File Edit Shell Debug options Window Help >>> checkpwd ('hello12') False >>> check pwd ('secret99') False >>> check _pwd ('12345') True >>> checkpwd ('123445 ') False >>> checkpwd ('12# #pwd') True Ln: 1834 Col: 4 Hint: Use isdigit() and isalphal) to test whether a letter is a digit or a letter, respectively

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!