← Back to all posts
##### Please do this as my friend needws it to be done he is very bad and so am i

5IB/G/Jun18/8520/CA/CB/CC/CD/CEThe following examples show how the 'Check Password' option should work.EXAMPLE 1Entered password: aSD7V^&gS77+Initial scorePointsLength is 1313AdditionsPointsAt least one upper case character (S, Dand V)5At least one lower case character (aand g)5At least one symbol (^and &and and +)5At least one digit (7)5One of each of the above types10SubtractionsPointsSequence of letters (aSD)–5Point score for password aSD7V^&gS77+is 13 + 30 –5 = 38 so this is a strong password.EXAMPLE 2Entered password: qwerty123Initial scorePointsLength is 99AdditionsPointsAt least one lower case character (q, w, e, r, tand y)5At least one digit (1, 2and 3)5SubtractionsPointsConsecutive alphabetic characters (qwe, wer, ertand rty)–20Point score for password qwerty123is 9 + 10 –20 = –1 so this is a weak password.

hotnewtop
InvisibleOne (3206)

I'm not supposed to just write the code for you, but assuming you are doing this in python it shouldn't be that hard.
First off, for the password generation you just need a list of all the characters you want to use to make a password:

``r = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] # etc...``

and then ask the user how long they want the password to be:

``length = input("Password Length: (number) ")``

convert that to an integer

``length = int(length)``

and then use a for loop with `range` to build the password

``````password = "" # nothing, we will add on with the loop

for i in range(length):
random_char = random.choice(r) # randomly pick a character

And then for the scoring system. First you need to get the users password:

``password = input("Password: ")``

Make an empty variable to hold the points

``points = 0``

check how long the password is:

``password_length = len(password)``

``score += password_length``

Split the password into a list:

``password_split = [char for char in password]``

make four lists, one of numbers, one of letters, one of capital letters, and one of symbols:

``````letters = ['a', 'b', 'c'] # etc..
caps = ['A', 'B', 'C'] # etc.
numbers = ['1', '2', '3'] #etc
symbols = ['!', '@', '#'] #etc``````

Loop through our split password and check the letters is a number, symbol, or letter and assign points accordingly.

``````for char in password_split:
if char in letters:
points += 1
elif char in caps:
points += 2
elif char in numbers:
points += 3
elif char in symbols:
points += 4``````

and finally tell them how strong their password was:

``print(f"Password Score: {str(points)}")``

That isn't exactly what you want, but that's the basic idea and you should be able to flesh it out and make it more to how it should be.

CodingCactus (4331)

The Ask board on Repl Talk is not for asking people to do things for you, it is for asking for help when you are struggling, and from what I can see you haven't even attempted this problem yourself.