Password Generator | Sololearn: Learn to code for FREE!

+3

Password Generator

Created my first password generator (one of my first program) like it? :D https://code.sololearn.com/cRHsubgX32zL/?ref=app

5/27/2018 2:44:24 PM

Jessica

8 Answers

New Answer

+3

May I introduce my optimized version: https://code.sololearn.com/cTpxZAG6zws0/?ref=app

+1

I have a few improvements you could do to make the code better. Firstly you don’t have to make 7 lists that are the same, you can just use 1 in the program. You should also store the characters as a string making it easier to change ect. Putting the random generation in a loop wouldn’t hurt too.

+1

how do i put it in a loop?

0

Could you remake it ?

0

Actually you could use a loop or list comprehension (which you probably haven’t learned yet) Loop: for _ in range(how many characters you want): print(random.choice(characters), end="") # end tells the print function what the last character should be (default is \n) in this case its nothing List comprehension: print("".join([random.choice(characters) for _ in range(how many characters you want)]))

0

https://code.sololearn.com/coHx96tLC8uK/?ref=app There :)

0

thanks :)

0

My passwords Generator with your own alphabet) https://code.sololearn.com/ckU6p3GEKblP/?ref=app