Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a python program (passwords.py) that will generate and print a passwords according to the following rules: Starts with an uppercase letter. Includes one special

Write a python program (passwords.py) that will generate and print a passwords according to the following rules:

Starts with an uppercase letter.

Includes one special character randomly selected from the string: !@#$

Includes at least six lower-case letters.

Ends with one integer in the range of 0 to 9 (inclusive).

The program should prompt the user for the length of the password, which should be at least 9).

The user should decide if they want to create more passwords as shown in the sample output below.

Implementation details:

The valid ASCII codes for uppercase characters are 65..90, and for lowercase characters are 97..122. Hint: use the chr() function.

Your program should verify that the user provided a valid input for the size of the password, otherwise it should prompt the user again.

o Invalid input would be anything that is not a number or any integer < 9.

o The size of the password determines the number of lowercase characters that the password will include.

You should avoid infinite loops and the break statement.

Sample Output:

Enter the size of your password: 10

Suggested password: Y!mebjivm7

Are you satisfied with your password (yes/no)? No

Enter the size of your password: 12

Suggested password: O@eqdafkjig2

Are you satisfied with your password (yes/no)? NO

Enter the size of your password: 8

The password should be at least 9 characters. Try again!

Enter the size of your password: 15

Suggested password: V$drvebtbakswx7

Are you satisfied with your password (yes/no)? no

Enter the size of your password: twelve

The size should be a number. Try again!

Enter the size of your password: 12

Suggested password: Q#lcuzccopr8

Are you satisfied with your password (yes/no)? yeah

Great! This password is random enough!

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

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago