Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How do I write this in Python? One common requirement for passwords is that they be at least 8 characters long. In this challenge, you

How do I write this in Python?

image text in transcribed

One common requirement for passwords is that they be at least 8 characters long. In this challenge, you will first ask the user for a password with input(). You will then implement user input validation using a while loop that checks if the provided password is at least 8 characters long. If not, the loop body asks the user to provide a different password, using input(). This is repeated until the user gives a password that is long enough. At the end of your program, print the valid password that the user gave. Some notes on the Sample Input in the tests: For each sample input, there a couple lines of strings. Each of these strings represents a password that is supplied by the user once input is called. The strings will be supplied in order. For each test, each time that your program calls input, it will read one of these strings, starting with the one on the first line. If it ends up calling input() again (asking the user to give a different password), then it will read in the string on the next line, and so forth. We have already added the initial call to input below. You should implement your while loop below such that it prints the final accepted password. For testing purposes, do not provide any strings to your input() calls. For example with sample input 1: 1. The first time input is called, the test will provide "monday". 2. Since the length of "monday" is only 6 characters long, your code should call input() again. 3. For this input call, the test will then provide "tuesday". 4. Since the length of "tuesday" is only 7 characters long, your code should call input() again. 5. For this input call, the test will then provide "wednesday". 6. Since "wednesday" is 9 characters long, it passes our requirement. 7. Print "wednesday

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

Known for something in business circles?

Answered: 1 week ago