Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Have you ever had the experience while creating an account on a website, and as you're typing in your password, a little meter pops up

image text in transcribed

Have you ever had the experience while creating an account on a website, and as you're typing in your password, a little meter pops up to tell you how "strong" your password is? Let's create our own version of that meter. Complete the function password_strength, that takes one argument, password, which is a string of characters consisting of lowercase letters, uppercase letters, digits and non-alphanumerical symbols. The function allocates points to password based on the location of certain characters in the string. The total at the end is a "score" of sorts that measure how strong the password is. Rule Points to Add the first character is a digit +40 a digit that is anywhere else +25 for each such digit the first character is an uppercase letter +25 the last character is a lowercase letter +15 a lowercase letter that is anywhere else +5 for each such lowercase letter Examples: Function Call Return Value 5 85 135 35 password_strength('f'BACG') password_strength('W63UtHTUN') password_strength( 'Msq08#2wGpMm) password_strength('qHjTt9YO') password_strength('gw74x512') password_strength('96B9T (J) password_strength('y*n(qeXxVp2') password_strength('lfxus') 105 70 45 30 [] def password_strength(password): pass # delete this line and start writing your code here

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_2

Step: 3

blur-text-image_3

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

The Database Experts Guide To SQL

Authors: Frank Lusardi

1st Edition

0070390029, 978-0070390027

More Books

Students also viewed these Databases questions