Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2) Complete the following: a) Write a function, generate_password(n) where n is the length of the password. The function should generate a password with n/2

image text in transcribed
2) Complete the following: a) Write a function, generate_password(n) where n is the length of the password. The function should generate a password with n/2 letters and n/2 (+1 if odd) digits. The letters should be randomly selected from a -z, and you should randomly capitalize the letters before adding to the password. b) Write a script that generates passwords using the lengths input from the user. passwords until the user inputs-1 to quit. The input length of a password cannot be less than 5 and your program should validate the input and prompt again for invalid input. Sample Run: Enter password length (-1 to quit): 5 Your password is: aq373 You should generate Enter password length (-1 to quit): 4 Password minimum length is!5 Enter password length Your password is: qSm354 Enter password length (-1 to quit): 9 Your password is: jkerdo996 Enter password length (-1 to quit): -1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

what is the key controllable factor in global marketing

Answered: 1 week ago

Question

explain what is meant by redundancy

Answered: 1 week ago