create our own version of that meter. Complete the function password aracters consisting of lowercase letters, uppercase letters, digits and word based on the location of certain characters in the string. The tot mber that you can use int() to convert a digit character into actual Points to Add ftmost character is one of the symbols !, e, #, or $ +40 ftmost character is a digit +30 en digit anywhere but the leftmost position Id digit anywhere but the leftmost position +20 for each such digit +25 for each such digit ercase letter anywhere +5 for each such lowercase letter +15 (in addition to the +5 from the st character is a lowercase letter ples:

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Have you ever had the experience, while creating an account on a website, that 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 the
password based on the location of certain characters in the string. The total at the end is a "score" that measures how strong the password is.
Remember that you can use int() to convert a digit character into actual integer value.
Points to Add
+40
+30
+20 for each such digit
+25 for each such digit
+5 for each such lowercase letter
+15 (in addition to the +5 from the previous rule)
Rule
the leftmost character is one of the symbols !, e, #, or $
the leftmost character is a digit
an even digit anywhere but the leftmost position
an odd digit anywhere but the leftmost position
a lowercase letter anywhere
the last character is a lowercase letter
Examples:
Function Call
password_strength('! Foo')
password_strength('@#Okayz ' )
password_strength('bGWp')
password_strength ( 'PPPPPP121k')
password_strength('!123321strongpassword')
password_strength('9hehe@')
password_strength('$securedpassword')
password_strength('.exestrongpassword')
password_strength('1 == 1')
password_strength('2345678')
[ ]
Return Value
3
4
65
75
25
90
265
50
130
100
55
165
1 def password_strength (password):
2
return 0 # DELETE THIS LINE and start coding here.
# Remember: end all of your functions with a return statement, not a print statement!
5
6 # Test cases.
7 print (password_strength('! Foo'))
8 print (password_strength('@#Okayz'))
9 print (password_strength('bGWp'))
10 print (password_strength('PPPPPP121k'))
11 print (password_strength('!123321strongpassword'))
12 print (password_strength('9hehe@'))
13 print
(password_strength('$securedpassword'))
14 print (password_strength('.exestrongpassword'))
15 print (password_strength('1 == 1'))
16 print (password_strength('2345678'))
Transcribed Image Text:Have you ever had the experience, while creating an account on a website, that 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 the password based on the location of certain characters in the string. The total at the end is a "score" that measures how strong the password is. Remember that you can use int() to convert a digit character into actual integer value. Points to Add +40 +30 +20 for each such digit +25 for each such digit +5 for each such lowercase letter +15 (in addition to the +5 from the previous rule) Rule the leftmost character is one of the symbols !, e, #, or $ the leftmost character is a digit an even digit anywhere but the leftmost position an odd digit anywhere but the leftmost position a lowercase letter anywhere the last character is a lowercase letter Examples: Function Call password_strength('! Foo') password_strength('@#Okayz ' ) password_strength('bGWp') password_strength ( 'PPPPPP121k') password_strength('!123321strongpassword') password_strength('9hehe@') password_strength('$securedpassword') password_strength('.exestrongpassword') password_strength('1 == 1') password_strength('2345678') [ ] Return Value 3 4 65 75 25 90 265 50 130 100 55 165 1 def password_strength (password): 2 return 0 # DELETE THIS LINE and start coding here. # Remember: end all of your functions with a return statement, not a print statement! 5 6 # Test cases. 7 print (password_strength('! Foo')) 8 print (password_strength('@#Okayz')) 9 print (password_strength('bGWp')) 10 print (password_strength('PPPPPP121k')) 11 print (password_strength('!123321strongpassword')) 12 print (password_strength('9hehe@')) 13 print (password_strength('$securedpassword')) 14 print (password_strength('.exestrongpassword')) 15 print (password_strength('1 == 1')) 16 print (password_strength('2345678'))
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Hiring Problem
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education