Question: Python coding Question 2 (6 points): Define a random password generator function, similar to the lab question. Your function should take one input n, which

Python coding

Python coding Question 2 (6 points): Define a random password generator function,

Question 2 (6 points): Define a random password generator function, similar to the lab question. Your function should take one input n, which will be the length of the password to be generated. For this problem, make sure that n is between 8 and 16, and if the user enters an integer less than 8 you should instead assume n = 8, and if the user enters an integer greater than 16 you should 16. Your function should import the random module and use the random.choice( ) function to print out a random string of n characters from these possible characters: assumen Any character from abcdefghijklmnopqrstuvwxyz' Any character from 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' Any character from 0123456789' Any of the special characters ! @#$%^&*() The password must contain at least one uppercase letter, at least one lowercase letter, at least one digit, and at least one special character. In addition, the password may not contain more than 3 letters (either upper case or lower case) in a row. If either of these conditions are violated, simply re-roll a new random password from scratch (and do this as many times as necessary). For full credit, each character must be randomly chosen from one of these four categories with equal probability among the four categories (meaning each category has a 25% chance of being picked from each time). Also for full credit, you should create at least one "helper function (google "helper function if you don't know what it means) to break down this task into smaller tasks. If you find yourself nesting loops and if statements more than 3-ish levels deep, you should really create a helper function to reduce the amount of nesting involved in the main function. Do your best

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!